-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ESLint config to flat config
- Loading branch information
Showing
7 changed files
with
96 additions
and
40 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import babelParser from '@babel/eslint-parser' | ||
import js from '@eslint/js' | ||
import eslintConfigPrettier from 'eslint-config-prettier' | ||
import eslintPluginImportX from 'eslint-plugin-import-x' | ||
import globals from 'globals' | ||
|
||
export default [ | ||
js.configs.recommended, | ||
// eslintPluginImportX.configs.recommended, // not yet available | ||
eslintConfigPrettier, | ||
{ | ||
languageOptions: { | ||
parser: babelParser, | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
linterOptions: { | ||
reportUnusedDisableDirectives: 'error', | ||
}, | ||
plugins: { | ||
import: eslintPluginImportX, | ||
}, | ||
rules: { | ||
'import/order': [ | ||
'error', | ||
{ | ||
alphabetize: { | ||
order: 'asc', | ||
}, | ||
}, | ||
], | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: 80, | ||
tabWidth: 2, | ||
ignoreUrls: true, | ||
ignoreComments: false, | ||
ignoreRegExpLiterals: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*', 'jest.*'], | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
context: 'readonly', | ||
}, | ||
}, | ||
}, | ||
{ | ||
ignores: [ | ||
'coverage/**/*', | ||
'dist/**/*', | ||
'docs/**/*', | ||
'jsdoc/**/*', | ||
'lib/**/*', | ||
'node_modules/**/*', | ||
'plugin.js', | ||
], | ||
}, | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 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