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.

Bug: [new config system] globs are ignoring dot files

See original GitHub issue

Environment

Node version: v16.14.0 npm version: v8.3.1 Local ESLint version: v8.23.0 (Currently used) Global ESLint version: Not found Operating System: win32 10.0.19044

What parser are you using?

Default (Espree)

What did you do?

// eslint.config.js

module.exports = [];
// .foo.js
npx eslint *.js -f tap

What did you expect to happen?

Per the RFC, this should include .foo.js?

  1. Defaults - by default, ESLint will ignore node_modules and .git directories only. This is different from the current behavior where ESLint ignores node_modules and all files/directories beginning with a dot (.).

In that case, I would expect this output:

TAP version 13
1..2
ok 1 - D:\tmp\tmp\.foo.js
ok 2 - D:\tmp\tmp\eslint.config.js

What actually happened?

The .foo.js file was not linted:

TAP version 13
1..1
ok 1 - D:\tmp\tmp\eslint.config.js

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Nov 14, 2022

Now that we have rewritten the search functionality, we are actually finding dot files by default. As it is now, it will end up being more difficult to mimic the eslintrc functionality than it will be to ensure the originally intended functionality works. Given that, I think the best path forward now is to include dot files in the glob patterns by default.

0reactions
mdjermanoviccommented, Dec 9, 2022

@mvorisek this issue and the fix are only about the new config system (eslint.config.js).

In the current config system, dotfiles and dotfolders are still ignored by default, as described in Ignoring Code. That will remain unchanged in the current config system, so the solution is to unignore them either in .eslintignore file or with ignorePatterns config option, just like you did.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fix: Ensure that dot files are found with globs. #16550 - GitHub
I had to adjust some existing tests because they had dot files in the directories ... Bug: [new config system] globs are ignoring...
Read more >
how to glob every hidden file except current and parent directory
The first glob below requires a leading dot and at least one additional non-dot character. These two globs together will match any possible...
Read more >
rg <Pattern> [Path...] - Fig.io
Options ; --no-heading, Don't group matches by each file ; --no-ignore, Don't respect ignore files (.gitignore, .ignore, etc.) ; --no-ignore-dot, Don't respect ....
Read more >
Configuring Jest
Thresholds for globs are applied to all files matching the glob. If the file specified by path is not found, an error is...
Read more >
Why do glob.glob and pathlib.Path.glob treat hidden files ...
I'd like to know if this is intended or possibly a bug/oversight. The glob module documentation states that files starting with a dot...
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