Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

My react app works as normal using npm start, but when I try npm run build I got trouble.

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! [email protected] lint: `eslint 'src/**/*{.ts,.tsx}'`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] 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! [email protected] prebuild: `npm-run-all clean lint && aurora-mi git`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

The Babel config file contains this:

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

I have tried node v 13.7.0 and 14.1.0. Does anybody know how to solve this problem?

like image 916
Magnus Strand Avatar asked Aug 11 '20 08:08

Magnus Strand


1 Answers

Seems like it is linting node_modules too

To fix this you can create file .eslintignore in your root directory and add node_modules/ folder to your eslintignore file

like image 181
Shayan Moghadam Avatar answered Nov 06 '22 19:11

Shayan Moghadam