-
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
Conversation
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.
Also consider basing this config on https://github.com/neostandard/neostandard instead and help out getting a good base config for the ecosystem at large. (neostandard
is a maintained open governance fork of the standard
project)
parserOptions: { | ||
const globals = require("globals") | ||
const js = require("@eslint/js") | ||
const pluginNode = require("eslint-plugin-node") |
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 official eslint-community
: https://github.com/eslint-community/eslint-plugin-n
const globals = require("globals") | ||
const js = require("@eslint/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 comment
The 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 js = require("@eslint/js") | ||
const pluginNode = require("eslint-plugin-node") | ||
const pluginImport = require("eslint-plugin-import") | ||
const pluginPromise = require("eslint-plugin-promise") |
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.
Does not yet support ESLint 9: eslint-community/eslint-plugin-promise#449 We will get to it within the eslint-community
See also: neostandard/neostandard#14
{ | ||
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', | ||
}, |
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.
Add descriptive names to these to more easily identify them in eg. the config inspector, eg:
{ | |
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', | |
}, | |
{ | |
name: 'Test adaptions', | |
files: ['test/**'], | |
rules: { | |
'no-global-assign': 'off', | |
'no-extend-native': 'off', | |
}, | |
}, { | |
name: 'Shipping code adaptions', | |
files: ['lib/**', 'bin/**'], | |
rules: { | |
'import/no-extraneous-dependencies': ['error', { devDependencies: false }], | |
}, | |
}, { | |
name: 'Shipping code adaptions, non-cli', | |
files: ['lib/**'], | |
rules: { | |
'no-console': 'error', | |
}, |
sourceType: 'script', | ||
globals: { | ||
...globals.browser, |
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.
The previous env
was es6
+ node
, not browser
+ node
@voxpelli thanks for your contributions here, I was editing the |
References