@lexstile

Почему Eslint не работает в jsx в VS code?

.eslintrc
spoiler
{
  "env": {
    "browser": true,
    "node": true,
    "es6": true
  },
  "parser": "babel-eslint",
  "globals": {
    "window": true,
    "fetch": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:promise/recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "prettier"
  ],
  "rules": {
    "prettier/prettier": "error",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "react/jsx-max-props-per-line": [1,
      {
        "maximum": 5
      }
    ]
  },
  "parserOptions": {
    "ecmaVersion": 8,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true,
      "modules": true,
      "experimentalObjectRestSpread": true
    }
  },
  "settings": {
    "react": {
      "version": "17.0.2"
    },
    "import/resolver": "webpack"
  },
  "plugins": [
    "react",
    "react-hooks",
    "prettier",
    "import",
    "promise"
  ]
}

.prettierrc
spoiler
{
  "printWidth": 120,
  "tabWidth": 2,
  "trailingComma": "es5",
  "singleQuote": true,
  "arrowParens": "always",
  "endOfLine": "lf"
}

package.json
spoiler
{
  "name": "test",
  "version": "1.0.0",
  "description": "test description",
  "main": "index.js",
  "scripts": {
    "start": "webpack serve --mode development --open chrome --hot",
    "build": "webpack --mode production"
  },
  "keywords": [
    "keywords"
  ],
  "author": "No name",
  "license": "MIT",
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.(js|jsx)": "npm run lint"
  },
  "devDependencies": {
    "@babel/cli": "^7.13.10",
    "@babel/core": "^7.13.10",
    "@babel/plugin-proposal-object-rest-spread": "^7.13.8",
    "@babel/preset-env": "^7.13.12",
    "@babel/preset-react": "^7.12.13",
    "autoprefixer": "^10.2.5",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.2.2",
    "css-loader": "^5.2.0",
    "eslint": "^7.22.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-import-resolver-webpack": "^0.13.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-promise": "^4.3.1",
    "eslint-plugin-react": "^7.23.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "html-webpack-plugin": "^5.3.1",
    "husky": "^5.2.0",
    "lint-staged": "^10.5.4",
    "mini-css-extract-plugin": "^1.3.9",
    "node-sass": "^5.0.0",
    "postcss": "^8.2.8",
    "postcss-cli": "^8.3.1",
    "postcss-custom-properties": "^11.0.0",
    "postcss-flexbugs-fixes": "^5.0.2",
    "postcss-loader": "^5.2.0",
    "postcss-prefixer": "^2.1.2",
    "prettier": "^2.2.1",
    "redux-devtools-extension": "^2.13.9",
    "sass-loader": "^11.0.1",
    "webpack": "^5.28.0",
    "webpack-cli": "^4.5.0",
    "webpack-dev-server": "^3.11.2"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "classnames": "^2.2.6",
    "core-js": "^3.9.1",
    "final-form": "^4.20.2",
    "final-form-arrays": "^3.0.2",
    "lodash": "^4.17.21",
    "normalize.css": "^8.0.1",
    "postcss-csso": "^5.0.0",
    "postcss-import": "^14.0.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-final-form": "^6.5.3",
    "react-final-form-arrays": "^3.1.3",
    "react-redux": "^7.2.3",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0"
  }
}
  • Вопрос задан
  • 215 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
23 нояб. 2024, в 00:16
2000 руб./за проект
22 нояб. 2024, в 23:55
3000 руб./за проект
22 нояб. 2024, в 22:26
3500 руб./за проект