-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: iverly <github@iverly.net>
- Loading branch information
Showing
16 changed files
with
2,753 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.next/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
reportUnusedDisableDirectives: true, | ||
ignorePatterns: ['next-env.d.ts'], | ||
env: { | ||
node: true, | ||
}, | ||
overrides: [ | ||
// Rules for all files | ||
{ | ||
files: '**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}', | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/typescript', | ||
'prettier', | ||
], | ||
plugins: ['import', 'unicorn'], | ||
rules: { | ||
'comma-dangle': ['error', 'always-multiline'], | ||
'prefer-object-has-own': 'error', | ||
'logical-assignment-operators': [ | ||
'error', | ||
'always', | ||
{ enforceForIfStatements: true }, | ||
], | ||
'no-else-return': ['error', { allowElseIf: false }], | ||
'no-lonely-if': 'error', | ||
'prefer-destructuring': [ | ||
'error', | ||
{ VariableDeclarator: { object: true } }, | ||
], | ||
'import/no-duplicates': 'error', | ||
'no-negated-condition': 'off', | ||
'unicorn/no-negated-condition': 'error', | ||
'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }], | ||
'object-shorthand': ['error', 'always'], | ||
'unicorn/prefer-regexp-test': 'error', | ||
'unicorn/no-array-for-each': 'error', | ||
'unicorn/prefer-string-replace-all': 'error', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
// todo: enable | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
}, | ||
}, | ||
// Rules for React files | ||
{ | ||
files: '{packages,examples,docs}/**', | ||
extends: [ | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
'plugin:@next/next/recommended', | ||
], | ||
rules: { | ||
'react/prop-types': 'off', | ||
'react/no-unknown-property': ['error', { ignore: ['jsx'] }], | ||
'react-hooks/exhaustive-deps': 'error', | ||
'react/self-closing-comp': 'error', | ||
'no-restricted-syntax': [ | ||
'error', | ||
{ | ||
// ❌ useMemo(…, []) | ||
selector: | ||
'CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]', | ||
message: | ||
"`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead.", | ||
}, | ||
{ | ||
// ❌ z.object(…) | ||
selector: | ||
'MemberExpression[object.name=z] > .property[name=object]', | ||
message: 'Use z.strictObject is more safe.', | ||
}, | ||
], | ||
'react/jsx-filename-extension': [ | ||
'error', | ||
{ extensions: ['.tsx', '.jsx'], allow: 'as-needed' }, | ||
], | ||
'react/jsx-curly-brace-presence': 'error', | ||
'react/jsx-boolean-value': 'error', | ||
}, | ||
settings: { | ||
react: { version: 'detect' }, | ||
}, | ||
}, | ||
// Rules for TypeScript files | ||
{ | ||
files: '**/*.{ts,tsx,cts,mts}', | ||
extends: [ | ||
// TODO: fix errors | ||
// 'plugin:@typescript-eslint/recommended-requiring-type-checking' | ||
], | ||
parserOptions: { | ||
project: ['tsconfig.json'], | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'@typescript-eslint/non-nullable-type-assertion-style': 'error', | ||
'@typescript-eslint/prefer-optional-chain': 'error', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,213 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
.pnp | ||
.pnp.js | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
node_modules | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
.vscode/ | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
## archives and compressed files | ||
*.7z | ||
*.jar | ||
*.rar | ||
*.zip | ||
*.gz | ||
*.bzip | ||
*.xz | ||
*.lzma | ||
*.tar | ||
*.tgz | ||
*.tar.gz | ||
*.iso | ||
*.dmg | ||
*.xpi | ||
*.gem | ||
*.egg | ||
*.deb | ||
*.rpm | ||
|
||
## common temp file patterns | ||
*~ | ||
*.*~ | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
|
||
## editors and ides | ||
|
||
### emacs | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
.elc | ||
auto-save-list | ||
tramp | ||
.\#* | ||
|
||
### vim | ||
*.un~ | ||
Session.vim | ||
|
||
## os-specific noise files | ||
|
||
### linux flavors | ||
.directory | ||
|
||
### osx | ||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
### windows | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
Thumbs.db | ||
|
||
## commonly used temp files and directories | ||
*.log | ||
*.pid | ||
log | ||
logs | ||
tmp | ||
temp | ||
|
||
## tags, gtags, etags, ctags | ||
GPATH | ||
GRTAGS | ||
GSYMS | ||
GTAGS | ||
TAGS | ||
|
||
# turbo | ||
.turbo | ||
|
||
# vercel | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules/ | ||
.next/ | ||
package.json | ||
package-lock.json | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const withNextra = require('nextra')({ | ||
theme: 'nextra-theme-docs', | ||
themeConfig: './theme.config.tsx', | ||
}) | ||
}); | ||
|
||
module.exports = withNextra() | ||
module.exports = withNextra(); |
Oops, something went wrong.