-
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.
feat: update eslint config to flat config
- Loading branch information
1 parent
27c3dab
commit 038e05b
Showing
15 changed files
with
2,235 additions
and
1,224 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 @@ | ||
v22.9.0 |
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,61 @@ | ||
import draconidesBaseConfig from '@draconides/eslint-config-base'; | ||
// import draconidesTsConfig from '@draconides/eslint-config-ts'; | ||
import jsdoc from 'eslint-plugin-jsdoc'; | ||
import tsdoc from 'eslint-plugin-tsdoc'; | ||
import globals from 'globals'; | ||
|
||
import { fileURLToPath } from 'node:url'; | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
export default [ | ||
...draconidesBaseConfig, | ||
// ...draconidesTsConfig, | ||
{ | ||
plugins: { | ||
jsdoc, | ||
tsdoc, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.jest, | ||
}, | ||
parserOptions: { | ||
projectService: true, | ||
project: './tsconfig.eslint.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'jsdoc/check-alignment': 1, | ||
'jsdoc/check-param-names': 1, | ||
'jsdoc/check-property-names': 1, | ||
'jsdoc/check-tag-names': 1, | ||
'jsdoc/check-values': 1, | ||
'jsdoc/empty-tags': 1, | ||
'jsdoc/implements-on-classes': 1, | ||
'jsdoc/multiline-blocks': 1, | ||
'jsdoc/no-multi-asterisks': 1, | ||
'jsdoc/require-jsdoc': 1, | ||
'jsdoc/require-param': 1, | ||
'jsdoc/require-param-description': 1, | ||
'jsdoc/require-param-name': 1, | ||
'jsdoc/require-property': 1, | ||
'jsdoc/require-property-description': 1, | ||
'jsdoc/require-property-name': 1, | ||
'jsdoc/require-returns': 1, | ||
'jsdoc/require-returns-check': 1, | ||
'jsdoc/require-returns-description': 1, | ||
'jsdoc/require-throws': 1, | ||
'jsdoc/require-yields': 1, | ||
'jsdoc/require-yields-check': 1, | ||
'jsdoc/sort-tags': 1, | ||
'jsdoc/tag-lines': 1, | ||
'tsdoc/syntax': 'warn', | ||
}, | ||
}, | ||
]; |
Large diffs are not rendered by default.
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
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 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,95 @@ | ||
import js from '@eslint/js'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import importPlugin from 'eslint-plugin-import'; | ||
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended'; | ||
|
||
export default [ | ||
eslintPluginPrettier, | ||
eslintConfigPrettier, | ||
js.configs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
{ | ||
files: ['**/*.{js,mjs,cjs}'], | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
tabWidth: 4, | ||
bracketSpacing: true, | ||
arrowParens: 'always', | ||
endOfLine: 'lf', | ||
semi: true, | ||
}, | ||
], | ||
|
||
'no-console': 'warn', | ||
'linebreak-style': ['error', 'unix'], | ||
|
||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
args: 'after-used', | ||
ignoreRestSiblings: false, | ||
}, | ||
], | ||
|
||
'no-import-assign': 'error', | ||
|
||
'no-undef': [ | ||
'error', | ||
{ | ||
typeof: true, | ||
}, | ||
], | ||
|
||
'no-unexpected-multiline': 'error', | ||
'no-self-assign': 'error', | ||
'no-unreachable': 'error', | ||
'no-unreachable-loop': 'error', | ||
'no-unsafe-optional-chaining': 'error', | ||
'no-use-before-define': 'error', | ||
'no-useless-backreference': 'error', | ||
|
||
'valid-typeof': [ | ||
'error', | ||
{ | ||
requireStringLiterals: false, | ||
}, | ||
], | ||
|
||
camelcase: 'error', | ||
curly: 'error', | ||
eqeqeq: 'error', | ||
'no-shadow': 'error', | ||
'no-var': 'error', | ||
radix: 'error', | ||
'import/first': 'error', | ||
'import/newline-after-import': 'error', | ||
'import/no-namespace': 'error', | ||
'import/no-empty-named-blocks': 'error', | ||
'import/no-useless-path-segments': 'error', | ||
'import/consistent-type-specifier-style': 'error', | ||
|
||
'import/order': [ | ||
'error', | ||
{ | ||
groups: ['index', 'sibling', 'parent', 'internal', 'external', 'builtin', 'object', 'type'], | ||
|
||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: true, | ||
}, | ||
|
||
'newlines-between': 'always', | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
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 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.
Oops, something went wrong.