Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve, craco: *** Cannot find ESLint loader (eslint-loader). *** error with ANTd and React (2021)

I am using ANTd with a React application I am building for a school project. The App runs fine however, on startup I get the following: craco: *** Cannot find ESLint loader (eslint-loader). *** which is concerning. I have looked into this and apparently this link https://github.com/gsoft-inc/craco/pull/219 offers support for the issue. I am not advanced enough to know how to apply this fix to my own React project and I feel myself and other beginners would benefit greatly from an explanation on how to do so. Thanks to whoever can help!

like image 977
Tom Avatar asked Nov 27 '22 13:11

Tom


1 Answers

For react, this happens when we have DISABLE_ESLINT_PLUGIN=true in our environment variable (or in the .env.production file). Instead, we should disable ESLint in craco.

Remove DISABLE_ESLINT_PLUGIN=true from environment variable or env file.
Then in craco.config.js, add this:

module.exports = {
  // ...
  eslint: {
    enable: false
  },
  // ...
}
like image 170
zhuhang.jasper Avatar answered Nov 29 '22 04:11

zhuhang.jasper