Skip to content
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

Error after updating eslint to 8.1.0 #427

Closed
1v3n opened this issue Oct 26, 2021 · 8 comments · Fixed by #431
Closed

Error after updating eslint to 8.1.0 #427

1v3n opened this issue Oct 26, 2021 · 8 comments · Fixed by #431

Comments

@1v3n
Copy link

1v3n commented Oct 26, 2021

Hey,

once I update eslint from 7.32.0 to 8.1.0. I see an error on my command line when I run prettier-eslint:

Scripts:

"prettier:watch": "onchange \"**/*.+(js|jsx|json|scss|css)\" -- prettier-eslint --write $PWD/{{changed}}",
"prettier:format": "prettier-eslint --write \"src/**/*.+(js|jsx|json|scss|css)\"",

My config:

  • prettier-eslint-cli version: 5.0.1
  • prettier version: 2.4.1
  • eslint version: 8.1.0

prettier-eslint shows error:

prettier-eslint [ERROR]: There was trouble creating the ESLint CLIEngine.
prettier-eslint-cli [ERROR]: There was an error formatting "/Users/me/workspace/company/app/frontend/package.json":
TypeError: CLIEngine is not a constructor
at getESLintCLIEngine (/Users/me/workspace/company/app/frontend/node_modules/prettier-eslint/dist/utils.js:403:12)
at getESLintConfig (/Users/me/workspace/company/app/frontend/node_modules/prettier-eslint/dist/index.js:210:51)
at format (/Users/me/workspace/company/app/frontend/node_modules/prettier-eslint/dist/index.js:75:71)
at MapSubscriber.project (/Users/me/workspace/company/app/frontend/node_modules/prettier-eslint-cli/dist/format-files.js:268:54)
at MapSubscriber._next (/Users/me/workspace/company/app/frontend/node_modules/rxjs/internal/operators/map.js:49:35)
at MapSubscriber.Subscriber.next (/Users/me/workspace/company/app/frontend/node_modules/rxjs/internal/Subscriber.js:66:18)
at AsyncSubject.Subject.next (/Users/me/workspace/company/app/frontend/node_modules/rxjs/internal/Subject.js:60:25)
at AsyncSubject.complete (/Users/me/workspace/company/app/frontend/node_modules/rxjs/internal/AsyncSubject.js:53:35)
at handler (/Users/me/workspace/company/app/frontend/node_modules/rxjs/internal/observable/bindNodeCallback.js:53:33)
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:69:3)
failure formatting 1 file with prettier-eslint

@1v3n 1v3n changed the title Error after udating eslint to 8.1.0 Error after updating eslint to 8.1.0 Oct 26, 2021
@chrisbobbe
Copy link

Supporting prettier-eslint, prettier, and eslint later than v9.0.2, v1.19.1, and v5.16.0, respectively, is #304. 😕

@YuliyaNovik
Copy link

https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0#remove-cliengine seems to be useful

@YuliyaNovik
Copy link

any updates?

@haase1020
Copy link

I am running into this issue as well when updating to eslint v8.13.0. Any updates or should I wait on updating eslint?

@idahogurl
Copy link
Collaborator

@haase1020 Support for ESLint 8 is coming (see prettier/prettier-eslint#696). However there was an issue with the publishing process and it didn't push out a new version. In short, do not update to ESLint 8 just yet.

@georgecrawford
Copy link

@idahogurl Thanks for your work on this. I'm running the following (all the latest versions, AFAICT):

"eslint": "8.13.0",
"prettier": "2.6.2",
"prettier-eslint": "14.0.0",
"prettier-eslint-cli": "5.0.1",

... and yet I'm still seeing:

$ ./node_modules/.bin/prettier-eslint file.js
prettier-eslint [ERROR]: There was trouble creating the ESLint CLIEngine.
prettier-eslint-cli [ERROR]: There was an error formatting "file.js":
    TypeError: CLIEngine is not a constructor
        at getESLintCLIEngine (./node_modules/prettier-eslint-cli/node_modules/prettier-eslint/dist/utils.js:403:12)
        at getESLintConfig (./node_modules/prettier-eslint-cli/node_modules/prettier-eslint/dist/index.js:210:51)
        at format (./node_modules/prettier-eslint-cli/node_modules/prettier-eslint/dist/index.js:75:71)
        at MapSubscriber.project (./node_modules/prettier-eslint-cli/dist/format-files.js:268:54)
        at MapSubscriber._next (./node_modules/rxjs/internal/operators/map.js:49:35)
        at MapSubscriber.Subscriber.next (./node_modules/rxjs/internal/Subscriber.js:66:18)
        at AsyncSubject.Subject.next (./node_modules/rxjs/internal/Subject.js:60:25)
        at AsyncSubject.complete (./node_modules/rxjs/internal/AsyncSubject.js:53:35)
        at handler (./node_modules/rxjs/internal/observable/bindNodeCallback.js:53:33)
        at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
failure formatting 1 file with prettier-eslint

@georgecrawford
Copy link

Since prettier/prettier-eslint#696 is merged and prettier-eslint supports ESLint v8, what are the chances of this project upgrading eslint and prettier-eslint?

@idahogurl idahogurl linked a pull request Apr 28, 2022 that will close this issue
@smartdev322
Copy link

hey @georgecrawford same here

    "@nuxtjs/style-resources": "^1.2.1",
    "eslint": "^8.14.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-vue": "^8.7.1",
    "prettier": "^2.4.1",
    "prettier-eslint-cli": "^5.0.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants