请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

webstorm中eslint配置

老师我是用的webstorm,它是默认进行了eslint配置了吗,我没有进行eslint配置输入==并没有提示报错

{
  "name": "ts-antd",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.11.47",
    "@types/react": "^18.0.16",
    "@types/react-dom": "^18.0.6",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.7.4",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

正在回答 回答被采纳积分+3

2回答

张轩 2022-08-09 09:06:19

同学你好

帮你查询了一下 https://stackoverflow.com/questions/57944468/webstorm-2018-1-4-eslint-typeerror-this-cliengine-is-not-a-constructor

可以自己看一下,具体原因就是 eslint 版本和 webstorm 的版本不匹配,可以将 webstorm 升级到最新版本,或者将 eslint 降到 5 版本(不推荐,版本太低了),可以解决对应的问题。

0 回复 有任何疑惑可以回复我~
张轩 2022-08-08 15:09:57

同学你好 由于我使用的不是 webstrom,你可以看一下 webstorm 的官方文档:https://www.jetbrains.com/help/webstorm/eslint.html 

后面有很详细的,自动启用和手动启用的步骤,可以仔细看看

了解一下 webstorm 怎样启用

0 回复 有任何疑惑可以回复我~
  • 提问者 慕桂英6219641 #1
    安装eslint和插件之后报错,网上没有找到相同的错误
    TypeError: this.cliEngineCtor is not a constructor
        at ESLintPlugin.invokeESLint (D:\WebStorm 2021.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js:103:25)
        at ESLintPlugin.getErrors (D:\WebStorm 2021.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js:82:21)
        at ESLintPlugin.onMessage (D:\WebStorm 2021.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js:56:64)
        at Interface.<anonymous> (D:\WebStorm 2021.2\plugins\JavaScriptLanguage\jsLanguageServicesImpl\js-language-service.js:105:39)
        at Interface.emit (events.js:400:28)
        at Interface._onLine (readline.js:434:10)
        at Interface._normalWrite (readline.js:588:12)
        at Socket.ondata (readline.js:246:10)
        at Socket.emit (events.js:400:28)
        at addChunk (internal/streams/readable.js:293:12)
    回复 有任何疑惑可以回复我~ 2022-08-08 18:27:17

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信