Michael Sollazzo
Michael Sollazzo

Reputation: 3

Eslint wont work because of eslint plugin error?

I can't seem to get my eslint to work.

I have the eslint extenstion on vscode. I created a new node project and npm installed eslint as a dev dependency. I chose the Air-BNB style and then went to check if it worked. Whenever I open a file I get a notification saying there is an error with eslint.

Vscode notification error message

ESlint stack trace error output

Some things I did:

My Config File:

module.exports = {
  env: {
    browser: true,
    commonjs: true,
    es2020: true,
  },
  extends: [
    'airbnb-base',
  ],
  parserOptions: {
    ecmaVersion: 11,
  },
  rules: {
  },
};

Here are my dev dependencies:

  "devDependencies": {
    "eslint": "^7.7.0",
    "eslint-config-airbnb-base": "^14.2.0",
    "eslint-plugin-import": "^2.22.0",
    "eslint-plugin-require": "0.0.1"
  }

Upvotes: 0

Views: 5902

Answers (1)

David Bradshaw
David Bradshaw

Reputation: 13077

The problem is right their in the error message, you have two different versions of eslint-plugin-import in your node-modules tree. You just need to make sure you only have one version.

I expect you tried to add a newer version than the one used by CRA.

Upvotes: 1

Related Questions