mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
958 stars 167 forks source link

Incompatible with eslint 9.x #358

Closed rlindner81 closed 2 months ago

rlindner81 commented 2 months ago

Eslint migrated various methods from context to sourceCode. This makes the current plugin incompatible with eslint after the upgrade to 9.x.

https://eslint.org/docs/latest/use/migrate-to-9.0.0#-removed-multiple-context-methods

TypeError: context.getScope is not a function
Occurred while linting /Users/d057156/dev/afc/eslint.config.js:1
Rule: "node/no-restricted-require"
    at Program:exit (/Users/d057156/dev/afc/node_modules/eslint-plugin-node/lib/util/visit-require.js:39:58)
    at ruleErrorHandler (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/linter.js:1145:48)
    at /Users/d057156/dev/afc/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.leaveNode (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/node-event-generator.js:349:14)
    at runRules (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/linter.js:1186:40)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/Users/d057156/dev/afc/node_modules/eslint/lib/linter/linter.js:1910:31)
scagood commented 2 months ago

We have an updated fork of this plugin over at https://github.com/eslint-community/eslint-plugin-n

If you have any issue, please raise it over there and we will do our best to help :)

rlindner81 commented 2 months ago

@scagood Thanks for the heads up!