Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .*/ to eslint ignore #9456

Merged
merged 1 commit into from
Feb 24, 2021
Merged

Add .*/ to eslint ignore #9456

merged 1 commit into from
Feb 24, 2021

Conversation

chancancode
Copy link
Contributor

!.* was added to ensure js-based config files are linted (#8070)

However, this was probably too broad. An unintended consequence of that change was that the .git directory is now linted by eslint. The easiest way to observe this is to create a branch with .js in the name:

git checkout -b "foo.js"
yarn lint:js

This will now error since git created a file called foo.js in .git to maintain the metadata for this branch, but the file does not contain valid JavaScript.

In addition to these error scenarios, it causes unnecessary file scans. There are probably other caches by other tools other than git that could cause problems here as well.

`!.*` was added to ensure js-based config files are linted (#8070)

However, this was probably too broad. An unintended consequence
of that change was that the `.git` directory is now linted by eslint.

The easiest way to observe this is to create a branch with `.js` in the
name:

```shell
git checkout -b "foo.js"
yarn lint:js
```

This will now error since git created a file called `foo.js` in `.git`
to maintain the metadata for this branch, but the file does not
contain valid JavaScript.

In addition to these error scenarios, it causes unnecessary file
scans. There are probably other caches by other tools other
than git that could cause problems here as well.
@rwjblue rwjblue added the bug label Feb 24, 2021
@rwjblue rwjblue merged commit e7a5c47 into master Feb 24, 2021
@rwjblue
Copy link
Member

rwjblue commented Feb 24, 2021

Thank you!

@elwayman02
Copy link
Contributor

@chancancode should this also be added to .prettierignore, or is this only an issue for eslint specifically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants