-
Notifications
You must be signed in to change notification settings - Fork 143
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 v9 - context.getScope is not a function - API change #924
Comments
Thanks for reporting. In the current version of this plugin, we are only adding compatibility with flat config, but not officially with ESLint v9. I'm afraid you'll have to use the ESLint compatibility util until we release the next major of the plugin, where ESLint v9 will be properly supported. |
This below fixed the issue for me, it's a slight change compared to previous version fix pointed out in #899. {
...
files: ['**/*.test.{ts,tsx}'],
plugins: {
'testing-library': fixupPluginRules({
rules: testingLibrary.rules
})
},
rules: {
...testingLibrary.configs['flat/react'].rules,
'testing-library/no-container': 'off',
'testing-library/no-node-access': 'off'
}
...
} |
This comment was marked as outdated.
This comment was marked as outdated.
I have opened #925 which should resolve this without requiring a new major |
Would be great to update the peerDependencies to support ESLint v9. ESLint v8 has been deprecated: "ESLint v8.x reached end-of-life on 2024-10-05 and is no longer maintained." quoted on the official website. Thanks |
Sorry for not reacting to this. I'll try to get #925 merged this week. |
🎉 This issue has been resolved in version 6.3.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Have you read the Troubleshooting section?
Yes
Plugin version
v6.3.0
ESLint version
v9..9.0
Node.js version
20.16.0
package manager and version
yarn v1
Operating system
macOS
Bug description
Example error:
Steps to reproduce
run eslint in terminal or ide using eslint v9.9.0 and latest plugin.
Error output/screenshots
ESLint configuration
Not the whole config, just the part regarding test files.
The project is using
[email protected]
.Rule(s) affected
Seems like all of them.
Anything else?
It seems that
getScope
was moved fromcontext
tosourceCode
https://eslint.org/docs/latest/use/troubleshooting/v9-rule-api-changes
https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getscope()
Do you want to submit a pull request to fix this bug?
No
The text was updated successfully, but these errors were encountered: