question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for ESlint 8.0 in `vue-eslint-parser`

See original GitHub issue

Version

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 command cd 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

Screen Shot 2021-10-15 at 11 40 23 PM

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

Bug: TypeError: this.cliEngine is not a constructor

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:68
  • Comments:23

github_iconTop GitHub Comments

43reactions
naregkhodaniancommented, Dec 23, 2021

Can’t believe this issue is still happening

38reactions
Morl99commented, Oct 18, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found