Followup to this comment thread: https://github.com/facebookincubator/create-react-app/pull/1152#discussion_r90960900
When running the start or test lint issues or flow issues (with #1152) are not reported if they are not within a test file (not required by webpack, only seen by jest).
I see three acceptable UX here:
start script should explore test files as well and run the eslint loader (+ flow plugin) on ittest script should run eslint (+ flow) each time jest triggers a change from its watchThe first one would be the best, the last one would be ok, but let's try to avoid it!
Test files are completely ignored by static checks.
Run these commands in the project folder and fill in their results:
npm ls react-scripts (if you haven鈥檛 ejected): 0.8.1node -v: 6.7.0npm -v: 3.10.3yarn --version: 0.18.0Then, specify:
Can/will npm test lint without flow too?
npm run build runs the linter, is this not enough for your use case?
@gaearon My CI complained about some warnings, somehow I could not reproduce them locally. :/
I've added a lint script in package.json that just runs eslint, works for me now.
"scripts": {
"lint": "eslint src"
}
see https://github.com/thisconnect/cra-desktop/commit/02d3e2f37c63a87e08dbcb859ee850588d69306d
(This is a test repo that uses and instantiated create-react-app + electron as in PR https://github.com/facebookincubator/create-react-app/pull/1718)
My CI complained about some warnings, somehow I could not reproduce them locally. :/
The build script didn鈥檛 use to output warnings. It does now, if you update to [email protected] and higher.
Thanks @gaearon !!
This is interesting: https://github.com/rogeliog/jest-runner-eslint
Meh. It doesn't seem that important, and above all test runs must be fast. Happy to look at PRs implementing this but we won't be doing it ourselves.
Most helpful comment
This is interesting: https://github.com/rogeliog/jest-runner-eslint