-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to eslint flat config (#1607)
- Loading branch information
Showing
37 changed files
with
837 additions
and
655 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import js from '@eslint/js'; | ||
import globals from 'globals'; | ||
import mochaPlugin from 'eslint-plugin-mocha'; | ||
import nodePlugin from 'eslint-plugin-n'; | ||
import prettierPlugin from 'eslint-plugin-prettier/recommended'; | ||
|
||
export default [ | ||
{ | ||
ignores: ['public/js', '**/*.bundle.js'], | ||
}, | ||
|
||
js.configs.recommended, | ||
mochaPlugin.configs.flat.recommended, | ||
nodePlugin.configs['flat/recommended'], | ||
prettierPlugin, | ||
|
||
// components | ||
{ | ||
files: ['components/**'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
ungit: 'readonly', | ||
}, | ||
}, | ||
|
||
rules: { | ||
'n/no-missing-require': 'off', | ||
'n/no-unsupported-features/node-builtins': 'off', | ||
}, | ||
}, | ||
|
||
// public/source | ||
{ | ||
files: ['public/source/**'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
io: 'readonly', | ||
jQuery: 'writable', | ||
Raven: 'readonly', | ||
ungit: 'readonly', | ||
}, | ||
}, | ||
|
||
rules: { | ||
'n/no-missing-require': 'off', | ||
'n/no-unsupported-features/node-builtins': 'off', | ||
}, | ||
}, | ||
|
||
// public/main.js | ||
{ | ||
files: ['public/main.js'], | ||
|
||
rules: { | ||
'n/no-unpublished-require': [ | ||
'error', | ||
{ | ||
allowModules: ['electron'], | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
// source | ||
{ | ||
files: ['source/**'], | ||
|
||
rules: { | ||
'no-control-regex': 'off', | ||
'n/no-process-exit': 'off', | ||
}, | ||
}, | ||
|
||
// test | ||
{ | ||
files: ['test/**'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'mocha/no-mocha-arrows': 'off', | ||
}, | ||
}, | ||
|
||
// clicktests | ||
{ | ||
files: ['clicktests/**'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
ungit: 'readonly', | ||
}, | ||
}, | ||
|
||
rules: { | ||
'mocha/no-mocha-arrows': 'off', | ||
'mocha/no-setup-in-describe': 'off', | ||
}, | ||
}, | ||
|
||
// eslint.config.mjs | ||
{ | ||
files: ['eslint.config.mjs'], | ||
|
||
languageOptions: { | ||
sourceType: 'module', | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.