suppress-eslint-errors icon indicating copy to clipboard operation
suppress-eslint-errors copied to clipboard

Support ESLint 8

Open gabrieldeal opened this issue 3 years ago • 3 comments

When I try to run suppress-eslint-errors, I get this error:

ERR src/app/graphQlClient/index.ts Transformation error (CLIEngine is not a constructor) TypeError: CLIEngine is not a constructor at codeMod (/home/gabrielx/projects/oss/oss_ms_teams/node_modules/suppress-eslint-errors/transforms/suppress-eslint-errors.js:12:23)

My project uses ESLint and I see that CLIEngine has been removed in ESLint 8: https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0#the-cliengine-class-has-been-removed

gabrieldeal avatar Oct 26 '21 22:10 gabrieldeal

As a workaround, I was able to temporarily just revert from eslint": "^8.8.0, to eslint": "^7.32.0. Then I could run suppress-eslint-errors, and immediately switch back to the latest eslint.

Endran avatar Feb 10 '22 11:02 Endran

FYI: I recently developed a tool inspired by suppress-eslint-errors called eslint-interactive. This tool covers the functionality of suppress-eslint-errors and supports ESLint v8. Maybe this will help you.

mizdra avatar Mar 22 '22 16:03 mizdra

This also caught me up, but was able to use the recommended 7.32.0. @mizdra I would love to try yours out sometime as well. I like the interactive idea a lot!

erikmellum avatar Apr 25 '22 19:04 erikmellum

Fixed in 3.0.1

amanda-mitchell avatar Aug 26 '23 18:08 amanda-mitchell