Create-react-app: Why is ESLint configured as a Webpack preloader?

Created on 19 Sep 2016  路  2Comments  路  Source: facebook/create-react-app

ESLint has nothing to do with Webpack in our projects. We use Nuclide Diagnostics to get results from it and also have it in our npm test so it can stop CI from passing.

Was this done to workaround some technical issue or is there more to it?

Most helpful comment

No, there is no technical issue. It is convenient to have ESLint in preloaders so we can re-lint changes files fast and display the lint output in the terminal and in the browser console. Since we only use the linter for rules that commonly indicate mistakes, it is fairly informative.

You can still configure linting in your editor (usage guide has explicit instructions for doing so). But we think it's valuable for it to be available right in npm start. Beginners often don't configure linters and then spend hours trying to fix simple mistakes which would have been reported. Putting linting right in the process in my view is better than hoping the person knows how to configure the editor, or that they would run lint occasionally.

All 2 comments

No, there is no technical issue. It is convenient to have ESLint in preloaders so we can re-lint changes files fast and display the lint output in the terminal and in the browser console. Since we only use the linter for rules that commonly indicate mistakes, it is fairly informative.

You can still configure linting in your editor (usage guide has explicit instructions for doing so). But we think it's valuable for it to be available right in npm start. Beginners often don't configure linters and then spend hours trying to fix simple mistakes which would have been reported. Putting linting right in the process in my view is better than hoping the person knows how to configure the editor, or that they would run lint occasionally.

Thanks for clarification.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

barcher picture barcher  路  3Comments

alleroux picture alleroux  路  3Comments

adrice727 picture adrice727  路  3Comments

rdamian3 picture rdamian3  路  3Comments