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

Sign up to request clarification or add additional context in comments.

1 Comment

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.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.