-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: switch to eslint flat config (#577)
* refactor: switch to eslint flat config * rename eslintConfigESLint variable
- Loading branch information
1 parent
8f49ade
commit 408eabd
Showing
20 changed files
with
95 additions
and
86 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ dist | |
npm-debug.log | ||
_test.js | ||
.idea | ||
.vscode | ||
.nyc_output | ||
.eslint-release-info.json | ||
yarn.lock | ||
|
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,54 @@ | ||
import eslintConfigESLint from "eslint-config-eslint"; | ||
import nodeRecommendedModule from "eslint-plugin-n/configs/recommended-module.js"; | ||
import nodeRecommendedScript from "eslint-plugin-n/configs/recommended-script.js"; | ||
import globals from "globals"; | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
"tests/fixtures/", | ||
"dist/", | ||
"coverage/", | ||
"tools/create-test-example.js" | ||
] | ||
}, | ||
|
||
// eslintConfigESLint[3] is eslint-plugin-n's recommended-script config | ||
...eslintConfigESLint.slice(0, 3), | ||
{ | ||
files: ["**/*.js"], | ||
...nodeRecommendedModule | ||
}, | ||
{ | ||
files: ["**/*.cjs"], | ||
...nodeRecommendedScript | ||
}, | ||
...eslintConfigESLint.slice(4), | ||
|
||
{ | ||
settings: { | ||
jsdoc: { | ||
mode: "typescript" | ||
} | ||
} | ||
}, | ||
{ | ||
files: ["tests/lib/**"], | ||
languageOptions: { | ||
globals: { | ||
...globals.mocha | ||
} | ||
} | ||
}, | ||
{ | ||
files: ["tools/**"], | ||
rules: { | ||
"no-console": "off", | ||
"n/no-process-exit": "off", | ||
"n/no-unsupported-features/es-syntax": ["error", { | ||
version: ">=16.0.0", | ||
ignores: ["modules"] | ||
}] | ||
} | ||
} | ||
]; |
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
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
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
Oops, something went wrong.