Skip to content

Cannot use .eslintignore for generated files #7339

Closed
@danielkcz

Description

@danielkcz

Describe the bug

When running yarn start, the ESLint errors are shown from files I have ignored with .eslintignore and the app won't start.

Did you try recovering your dependencies?

Reproducible in a fresh new project.

Which terms did you search for in User Guide?

eslintignore (yielded #6871)

Environment

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.1.0
    Internet Explorer: 11.0.17763.1
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-dom: ^16.8.6 => 16.8.6
    react-scripts: 3.0.1 => 3.0.1
  npmGlobalPackages:
    create-react-app: Not Found

Expected behavior

To ignore specified files from ESLint checks and start the app. Talking here mostly about generated files which we cannot just modify with the comment to disable eslint. The best course of action is to just ignore these.

Quite an exhaustive issue #6871 talks about customizing ESLint config, but not much of the mention of utilizing .eslintignore which isn't exactly huge customization and shouldn't be prohibited like that.

I can use a workaround with cra-override, but I don't want to disable a conflicting rule for a whole project when the only a bunch of generated files is affected.

Actual behavior

image

I have VSCode properly working with ESLint in the project. The specified file is correctly ignored there.

Reproducible demo

https://github.com/FredyC/cra-eslint-ignore

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions