4

I am using create-react-app to start a new react project, and I want to use my own eslint configuration file, extending from the react-app one.

It seems like my .eslintrc file is not used at all, even though I placed it in the root folder. In my output terminal I can see the file is loaded from the node_modules folder:

.../node_modules/eslint/lib/api.js

Am I missing something, or should I save the file somewhere else?

Thanks.

VSCode screenshot

1
  • 1
    Create-react-app is a solution to use without override. If you want to use your own configuration yu have to eject and that's not as easy to do. Commented Jun 29, 2017 at 9:15

2 Answers 2

1

True, those files are not used by create-react-app.

It is still possible to disable ESLint rules using comments in the JavaScript files:

// eslint-disable-next-line react/style-prop-object

For more information see: http://eslint.org/docs/user-guide/configuring.html#configuring-rules

1
  • 1
    Thanks @Bjorn, I saw the possibility to add comments in files, but I wanted to have a more global solution. Is it possible to remove the eslint configuration shipped with create-react-app and add my own? In react-native I used npm install eslint-config-rallycoding.
    – gianni
    Commented Jun 30, 2017 at 18:56
1

According to the documentation, now it is available by setting the EXTEND_ESLINT env variable. But the feature is experimental right now.

See the Experimental: Extending the ESLint config section.

Not the answer you're looking for? Browse other questions tagged or ask your own question.