forked from mysticatea/eslint-plugin-node
-
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: support eslint.config.js (mysticatea#95)
- Loading branch information
1 parent
bea9981
commit ebc97bf
Showing
11 changed files
with
135 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @fileoverview the `recommended-module` config for `eslint.config.js` | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
|
||
"use strict" | ||
|
||
const mod = require("../lib/index.js") | ||
|
||
module.exports = { | ||
plugins: { n: mod }, | ||
languageOptions: { | ||
sourceType: "module", | ||
globals: mod.configs["recommended-module"].globals, | ||
}, | ||
rules: mod.configs["recommended-module"].rules, | ||
} |
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,17 @@ | ||
/** | ||
* @fileoverview the `recommended-script` config for `eslint.config.js` | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
|
||
"use strict" | ||
|
||
const mod = require("../lib/index.js") | ||
|
||
module.exports = { | ||
plugins: { n: mod }, | ||
languageOptions: { | ||
sourceType: "commonjs", | ||
globals: mod.configs["recommended-script"].globals, | ||
}, | ||
rules: mod.configs["recommended-script"].rules, | ||
} |
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,41 @@ | ||
/** | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
"use strict" | ||
|
||
const js = require("@eslint/js") | ||
const { FlatCompat } = require("@eslint/eslintrc") | ||
const globals = require("globals") | ||
const nodeRecommended = require("eslint-plugin-n/configs/recommended-script") | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}) | ||
|
||
module.exports = [ | ||
{ | ||
languageOptions: { globals: globals.mocha }, | ||
linterOptions: { reportUnusedDisableDirectives: true }, | ||
}, | ||
{ | ||
ignores: [ | ||
".nyc_output/", | ||
"coverage/", | ||
"docs/", | ||
"lib/converted-esm/", | ||
"test/fixtures/", | ||
], | ||
}, | ||
js.configs.recommended, | ||
nodeRecommended, | ||
...compat.extends("plugin:eslint-plugin/recommended", "prettier"), | ||
{ rules: { "eslint-plugin/require-meta-docs-description": "error" } }, | ||
{ | ||
// these messageIds were used outside | ||
files: ["lib/rules/prefer-global/*.js"], | ||
rules: { | ||
"eslint-plugin/no-unused-message-ids": 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
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