gund / eslint-plugin-deprecation

ESLint rule that reports usage of deprecated code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work with ESLint v8

boris-petrov opened this issue · comments

Updating ESLint to v8 leads to:

Oops! Something went wrong! :(

ESLint: 8.0.0

TypeError: Failed to load plugin 'deprecation' declared in '.eslintrc.js': Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/home/boris/project/node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js:12:34)
    at Module._compile (/home/boris/project/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (/home/boris/project/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/boris/project/node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js:14:14)
    at Module._compile (/home/boris/project/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

#38 Seems to fix this.

commented

#38 Seems to fix this.

Any chance of getting this PR merged in?

Hello, how does this looks?

Want to add my voice as someone who needs this upgrade. Will unfortunately, (temporarily) remove this plugin as it is holding us back from upgrading to ESLint v8. Here's to hoping it gets merged soon 🙏 🍻

Well, as a work-around, my team has begun using @delagen/eslint-plugin-deprecation. Requires a bit of tweaking to your eslint config – discussion about it can be found at the bottom of #38

I've switched over to @delagen/eslint-plugin-deprecation as well and it works great. You'll need to make these changes in your config to make it work:

plugins:[
  "@delagen/deprecation" // Changed from "deprecation"
],
rules:{
  "@delagen/deprecation/deprecation": "warn" // Changed from "deprecation/deprecation": "warn"
}

This has been fixed in Delagen's fork and in v1.3.0! Thanks!