-
Notifications
You must be signed in to change notification settings - Fork 39
ESLint v9 compatibility #78
Comments
@karlhorky thanks for testing it with eslint v9! Indeed there are some BC that have to be addressed in order to support v9. If you like you are welcome to create a PR to fix this piece of code but it should be done in backwards compatible way just like they show in example, so we can keep supporting all previous eslint versions. Also if you decide to make a PR it would be necessary to update CI workflows to test this rule against both eslint v8 and v9, just like we already do with previous versions. But if you are not comfortable doing it no worries, I can adjust it on your PR as well 😊 |
Did some initial work on the v9 support but in general it's not possible to use it due to upstream dependencies not supporting it yet. |
typescript-eslint are at least preparing for it now, but this lib may need to also upgrade https://typescript-eslint.io/blog/announcing-typescript-eslint-v7/ They are dropping support for older typescript, node and eslint versions in that major (but otherwise it is unchanged). I look into adding support here for 6.x and 7.x at the same time, but I'm not sure that can work nicely without being a breaking change, due to how npm resolution works. As long as this library itself wants to support older eslint and node versions than typescript-eslint 7.x I'm not sure we can just add 7.x to the list of supported versions next to 6.x? |
Another data point: |
How is work going forward? This is blocking us from upgrading to eslint v9 and we cant already upgrade |
I'm seeing the following problem after upgrading to eslint 9:
My config looks like this: const eslintJs = require('@eslint/js');
const eslintTs = require('typescript-eslint');
const pluginDeprecation = require('eslint-plugin-deprecation');
const config = {
languageOptions: {
parser: eslintTs.parser,
parserOptions: {
project: 'tsconfig.lint.json'
}
},
plugins: {
deprecation: pluginDeprecation,
'@typescript-eslint': eslintTs.plugin
},
rules: {
'deprecation/deprecation': 'error'
}
}
module.exports = eslintTs.config(
eslintJs.configs.recommended,
...eslintTs.configs.strictTypeChecked,
...eslintTs.configs.stylisticTypeChecked,
config
); Am I doing it wrong or is this a compatibility issue? |
@ej612 In my case, it was due to having the rules active for JS files. Disabling type-aware rules in my JS files solved the problem. To then get it working with ESLint 9, I had to use This is what the final config looked like: import { fixupPluginRules } from "@eslint/compat";
import deprecationPlugin from "eslint-plugin-deprecation";
import tseslint from "typescript-eslint";
export default [
{
plugins: {
["@typescript-eslint"]: tseslint.plugin,
["deprecation"]: fixupPluginRules(deprecationPlugin),
},
languageOptions: {
parserOptions: {
project: true,
},
},
},
{
files: ["**/*.js"],
// Don't typecheck JS files
extends: [tseslint.configs.disableTypeChecked],
// Disable type-aware rules
rules: {
"deprecation/deprecation": "off",
},
},
]; |
this worked for me, thanks! |
Hi, Thanks! |
Workaround (switch from
|
Push! Would really love to update to v9 as well! Hope you are making progress on the PR and release soon 👀 |
Hey folks, sorry for a delay. |
Currently, using
[email protected]
,eslint-plugin-deprecation
fails with the following error:It looks like there's a blog post about preparing rules for ESLint v9 here:
From a quick look, it appears that
context.sourceCode.getAncestors(node)
should be used instead.The text was updated successfully, but these errors were encountered: