Add support for ESlint 8.0 in `vue-eslint-parser`
See original GitHub issueVersion
Vue CLI: 4.5.14
Environment info
Node version: v14.17.0
npm version: 6.14.13
Local ESLint version: 8.0.1
Operating System: macOS Big Sur
What did you do?
I’m using Vue CLI & after upgrading ESlint
from version 7.32.0
to 8.0.1
I get the error Syntax Error: TypeError: eslint.CLIEngine is not a constructor
after launching the project for development with npm run serve
.
// .eslintrc.js
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
parserOptions: {
parser: "babel-eslint"
}
};
Steps to reproduce
- Install Vue CLI globally, run the command:
npm install -g @vue/cli
. - Create a project, run the command
vue create todo-list-vue
. - Navigate to the project & install the latest version of
ESlint
, run the commandcd todo-list-vue && npm install eslint@latest
. - Launch the project for development, run the command
npm run serve
.
You will get the following error in the console: Syntax Error: TypeError: eslint.CLIEngine is not a constructor
What is expected?
Before upgrading ESlint
, I was able to launch the project for development without issues.
What is actually happening?
I got this error: Syntax Error: TypeError: eslint.CLIEngine is not a constructor
& my code won’t compile for development.
Related link
Issue Analytics
- State:
- Created 2 years ago
- Reactions:68
- Comments:23
Top Results From Across the Web
vue-eslint-parser - npm
Start using vue-eslint-parser in your project by running `npm i vue-eslint-parser`. There are 562 other projects in the npm registry using ...
Read more >User Guide | eslint-plugin-vue
This plugin supports the basic syntax of Vue.js 3.2, <script setup> , and CSS variable injection, but the ref sugar, an experimental feature...
Read more >vue-eslint-parser | Yarn - Package Manager
vuejs12.4mMIT9.1.0TS vulns 0 vulnerabilities. The ESLint custom parser for .vue files. ... Use it. $ yarn add vue-eslint-parser ... September 8, 2022: 9.1.0....
Read more >Migrating to v8.0.0 - ESLint - Pluggable JavaScript Linter
ESLint is officially dropping support for these versions of Node.js starting with ... you'll need to install the standalone eslint-formatter-codeframe or ...
Read more >User Guide | eslint-plugin-vue-scoped-css
npm install --save-dev eslint eslint-plugin-vue-scoped-css vue-eslint-parser. Requirements. ESLint v5.0.0 and above; Node.js v12.22.x, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can’t believe this issue is still happening
This is already fixed in https://github.com/vuejs/vue-cli/pull/6714 so a backport to the v4 line would be necessary. I think it would be great to support eslint 8 in vue-cli 4.x, since it will take people a while even after the v5 release to migrate their projects, and it would be problematic, to be stuck with eslint 7 in that case.