-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add support for eslint 9 #111
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,44 +1,28 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
module.exports = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
extends: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'eslint:recommended', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parserOptions: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const globals = require("globals") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failure on line 1 in lib/index.js
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const js = require("@eslint/js") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failure on line 2 in lib/index.js
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const pluginNode = require("eslint-plugin-node") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const pluginImport = require("eslint-plugin-import") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not yet support ESLint 9: import-js/eslint-plugin-import#2948 See also: neostandard/neostandard#15 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const pluginPromise = require("eslint-plugin-promise") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not yet support ESLint 9: eslint-community/eslint-plugin-promise#449 We will get to it within the See also: neostandard/neostandard#14 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { fixupPluginRules } = require("@eslint/compat") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const npmCliConfig = [{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
languageOptions: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ecmaVersion: 2022, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ecmaFeatures: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sourceType: 'script', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
globals: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...globals.browser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...globals.node, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
document: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
navigator: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
window: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
env: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
es6: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
node: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
plugins: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'node', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'import', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'promise', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
globals: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
document: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
navigator: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
window: 'readonly', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
plugins: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
node: fixupPluginRules(pluginNode), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import: pluginImport, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
promise: pluginPromise | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ignorePatterns: ['tap-snapshots/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
overrides: [{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['test/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-global-assign': 'off', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-extend-native': 'off', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['lib/**', 'bin/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'import/no-extraneous-dependencies': ['error', { devDependencies: false }], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['lib/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-console': 'error', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ignores: ['tap-snapshots/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'accessor-pairs': 'error', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'array-bracket-spacing': ['error', 'never'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -230,4 +214,27 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'promise/catch-or-return': 'error', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'promise/no-new-statics': 'error', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['test/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-global-assign': 'off', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-extend-native': 'off', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['lib/**', 'bin/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'import/no-extraneous-dependencies': ['error', { devDependencies: false }], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
files: ['lib/**'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'no-console': 'error', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+218
to
+233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add descriptive names to these to more easily identify them in eg. the config inspector, eg:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
module.exports = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
js.configs.recommended, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...npmCliConfig | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
eslint-plugin-n
instead, its the currently supported fork and maintained by us in the officialeslint-community
: https://github.com/eslint-community/eslint-plugin-n