question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint checks (and the upcoming Flow integration) is missing in tests

See original GitHub issue

Followup to this comment thread: https://github.com/facebookincubator/create-react-app/pull/1152#discussion_r90960900

Description

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

Expected behavior

I see three acceptable UX here:

  1. The start script should explore test files as well and run the eslint loader (+ flow plugin) on it
  2. The test script should run eslint (+ flow) each time jest triggers a change from its watch
  3. Add an independent script that will watch all files at the same time

The first one would be the best, the last one would be ok, but let’s try to avoid it!

Actual behavior

Test files are completely ignored by static checks.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): 0.8.1
  2. node -v: 6.7.0
  3. npm -v: 3.10.3
  4. yarn --version: 0.18.0

Then, specify:

  1. Operating system: macOS Sierra 10.12.2 Beta (16C41b)
  2. Browser and version: Google Chrome 54.0.2840.98 (64-bit)

Reproducible Demo

https://github.com/rricard/cra-failing-test-checks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
gaearoncommented, Sep 8, 2017
1reaction
gaearoncommented, Jan 8, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint checks (and the upcoming Flow integration) is missing ...
I see three acceptable UX here: The start script should explore test files as well and run the eslint loader (+ flow plugin)...
Read more >
Configure ESLint, Prettier, and Flow in VS Code for React ...
In this guide I will show you how to configure your editor to handle your code formatting, linting, and type checking.
Read more >
How to add a custom ESLint configuration to a Create React ...
Go to package.json at the root of the project, and remove the eslintConfig object. Add ESLint configuration.
Read more >
ESLint | WebStorm Documentation - JetBrains
WebStorm integrates with ESLint which brings a wide range of linting rules that can also be extended with plugins.
Read more >
VS Code ESLint extension - Visual Studio Marketplace
If you are new to ESLint check the documentation. The extension uses the ESLint library installed in the opened workspace folder. If the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found