簡體   English   中英

使用 ESLint 構建 react-webapp 時遇到問題; ESLint 找不到要擴展的配置“developit”

[英]Trouble building react-webapp with ESLint; ESLint couldn't find the config "developit" to extend from

我的 React 應用程序使用npm start正常工作,但是當我嘗試npm run build時我遇到了麻煩。

Oops! Something went wrong! :(

ESLint: 6.8.0.

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

The config "developit" was referenced from the config file in "/home/user/beregning-innsikt/beregning-innsikt-webapp/src/main/webapp/node_modules/@babel/preset-modules/package.json".

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

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! beregning-innsikt-webapp@2.0.0 lint: `eslint 'src/**/*{.ts,.tsx}'`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the beregning-innsikt-webapp@2.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-11T08_20_44_975Z-debug.log
ERROR: "lint" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! beregning-innsikt-webapp@2.0.0 prebuild: `npm-run-all clean lint && aurora-mi git`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the beregning-innsikt-webapp@2.0.0 prebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-11T08_20_45_002Z-debug.log

Babel 配置文件包含以下內容:

 "eslintConfig": {
    "extends": "developit",
    "rules": {
      "no-console": 0,
      "new-cap": 0
    }
  }, 

我已經嘗試過節點 v 13.7.0 和 14.1.0。 有人知道如何解決這個問題嗎?

似乎它node_modules

要解決此問題,您可以在根目錄中創建文件.eslintignore並將node_modules/文件夾添加到您的 eslintignore 文件中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM