DEV Community

Discussion on: Linting Your React+Typescript Project with ESLint and Prettier!

Collapse
 
nareshjbhatia profile image
Naresh Bhatia

Great article Dor! Quick question - how do you run eslint? From the command line? Have you found any way to tightly integrate with create-react-app? In other words, npm start should run your linter instead of create-react-app's.

Collapse
 
dorshinar profile image
Dor Shinar

Thank you!
I've looked into that a while ago. There's an issue on the create-react-app GitHub about that (I'll link it when I find it), basically they say that the ESLint configuration react-scripts uses cannot be altered, and it contains only rules that might prevent bugs (such as unused variable).
I run it with the command line, and I've set up git hooks to run it on every commit (using husky and lint-staged).

Collapse
 
nareshjbhatia profile image
Naresh Bhatia

Thanks for the response, Dor. Running husky/lint-staged is exactly what I am thinking of.

BTW, I am aware of the issue on the CRA repo: github.com/facebook/create-react-a.... See my comment on it related to this.

Thread Thread
 
dorshinar profile image
Dor Shinar

I was actually referring to this issue. Dan Abramov seemed pretty adamant there.

Thread Thread
 
nareshjbhatia profile image
Naresh Bhatia

Ah, thanks for digging it up!