Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eslint config error. ESLint couldn't find the config "dev" to extend from

I'm trying to set up eslint to TS react project, but run into err:

> eslint .


Oops! Something went wrong! :(

ESLint: 6.8.0.

ESLint couldn't find the config "dev" to extend from. Please check that the name of the config is correct.

The config "dev" was referenced from the config file in "C:\Users\User\Desktop\priority-style-react\example\node_modules\@csstools\convert-colors\package.json".

If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.

my package.json looks like:

{
  "name": "######",
  "version": "####",
  "description": "none",
  "author": "iLavs",
  "license": "MIT",
  "repository": "#####",
  "main": "dist/index.js",
  "module": "dist/index.es.js",
  "jsnext:main": "dist/index.es.js",
  "engines": {
    "node": ">=8",
    "npm": ">=5"
  },
  "scripts": {
    "lint": "eslint .",
    "build": "rollup -c",
    "start": "rollup -c -w",
  },
  "dependencies": {
    "classnames": "^2.2.6"
  },
  "peerDependencies": {
    "prop-types": "15.x",
    "react": "^15.0.0 || ^16.0.0",
    "react-dom": "^15.0.0 || ^16.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/plugin-proposal-class-properties": "^7.8.3",
    "@babel/preset-env": "^7.8.4",
    "@babel/preset-react": "^7.8.3",
    "@babel/preset-typescript": "^7.8.3",
    "@svgr/rollup": "^2.4.1",
    "awesome-typescript-loader": "^5.2.1",
    "babel-loader": "^8.0.6",
    "babel-plugin-import": "^1.12.0",
    "babel-plugin-require-context-hook": "^1.0.0",
    "babel-runtime": "^6.26.0",
    "cross-env": "^5.2.1",
    "declaration-bundler-webpack-plugin": "^1.0.3",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-plugin-import": "^2.20.1",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.18.3",
    "eslint-plugin-react-hooks": "^1.7.0",
    "markdown-loader": "^5.1.0",
    "mini-css-extract-plugin": "^0.7.0",
    "postcss-loader": "^2.1.6",
    "prettier": "^1.19.1",
    "react": "^16.12.0",
    "rollup": "^1.27.1",
    "rollup-plugin-babel": "^4.3.3",
    "rollup-plugin-commonjs": "^10.1.0",
    "rollup-plugin-node-resolve": "^5.2.0",
    "rollup-plugin-peer-deps-external": "^2.2.0",
    "rollup-plugin-postcss": "^2.0.3",
    "rollup-plugin-typescript2": "^0.25.2",
    "rollup-plugin-url": "^3.0.0",
    "sass-loader": "^7.1.0",
    "ts-loader": "^2.3.7",
    "ts-loader-decleration": "^0.10.4",
    "typescript": "^3.7.2",
    "url-loader": "^2.0.1"
  },
  "files": [
    "dist",
    "fonts",
    "style"
  ]
}

my .eslintrc.js:

module.exports = {
  env: {
    browser: true,
    es6: true,
  },
  extends: [
    'plugin:react/recommended',
    'airbnb',
  ],
  globals: {
    Atomics: 'readonly',
    SharedArrayBuffer: 'readonly',
  },
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  plugins: [
    'react',
    '@typescript-eslint',
  ],
  rules: {
  },
};

Can someone help me?

like image 804
Ihor Lavs Avatar asked Feb 23 '20 09:02

Ihor Lavs


2 Answers

This is probably a problem because eslint is running on the node modules. Try adding --ignore-pattern node_modules to your eslint command

like image 199
Charles L. Avatar answered Oct 23 '22 10:10

Charles L.


Finally, I've fixed the problem. I removed my package-lock.file and reinstall all the dependencies. The problem's gone.

like image 45
Ihor Lavs Avatar answered Oct 23 '22 10:10

Ihor Lavs