-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
ESLint 9 #34
ESLint 9 #34
Conversation
@@ -492,14 +495,6 @@ const invalidAndHasBlockStatement = [ | |||
code: 'async function foo(a) { console.log(3); }', | |||
output: 'const foo = async (a) => { console.log(3); };', | |||
}, | |||
{ |
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 new RuleTester
by ESLint fails if you have duplicated tests, so I had to remove a bunch of duplicated tests.
ecmaFeatures: { jsx: false }, | ||
ecmaVersion: 8, | ||
sourceType: 'module', | ||
// TODO: Remove this `languageOptions` once the tests are updated for flat config: |
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.
Once the tests are updated to support flat config, this can go back to the original values. The new default for RuleTester
expects flat config tests.
@@ -7,6 +7,9 @@ import { | |||
} from './config'; | |||
import rule from './prefer-arrow-functions'; | |||
|
|||
// TODO: Remove this once Jest starts supporting modern JavaScript | |||
globalThis.structuredClone ??= obj => JSON.parse(JSON.stringify(obj)); |
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.
Looks like ESLint now uses structuredClone so we need to "mock" it for Jest because Jest doesn't support that yet.
@@ -193,8 +193,8 @@ export default { | |||
}; | |||
|
|||
const isPrototypeAssignment = (node) => { | |||
return context | |||
.getAncestors() | |||
return sourceCode |
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.
These are the "key" changes, made following the official documentation.
Is there any update on this? We want to migrate to v9 and would love to continue using this plugin :) |
Same issue as @simonwst - I finally managed to get @JamieMason @loucyx is there anything missing from this PR before it can be merged? |
Not that I'm aware of. This is my first PR here, so maybe I missed something 😅 |
Description (What)
Bare minimum changes to have ESLint 9 support. Ideally tests should be updated to test flat config and a lot of types should be added, but this is the minimum changes to support ESLint 9.
Justification (Why)
To give support to folks upgrading to ESLint 9.
How Can This Be Tested?
yarn
to install the new dependencies.yarn test
to run the tests.