Symlinks to ignored files should be ignored
See original GitHub issueTell us about your environment
- ESLint Version: 4.14.0
- Node Version: 9.3.0
- npm Version: 5.5.1
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
My files are stored in an src/ directory and compiled into dist/ and I use symlinks to expose some files:
dist/
src/
|- index.js
-- bar.js
bar.js --> dist/bar.js
I only want to lint files in src/, not the ones output by Babel.
.gitignore:
/dist/
Command line used to run ESLint:
eslint --ignore-path .gitignore .
What did you expect to happen?
I expect ignored files to not be analyzed.
What actually happened? Please include the actual, raw output from ESLint.
ESLint finds errors in my symlink.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Telling git to ignore symlinks - Stack Overflow
This seems to be a better idea find . -type l | sed -e s'/^\.\///g' >> .gitignore. Find outputs a "./" prefix for...
Read more >gitignore Documentation - Git
DESCRIPTION. A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES ......
Read more >gitignore not being honored when using SymLinks
gitignore file but they will never be ignored, making it impossible for me to use Visual Studio to commit my changes as it...
Read more >gitignore - Specifies intentionally untracked files to ignore
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below...
Read more >How to skip symlinks when using git stash - Super User
Ignore symlinks. Add all symbolic links to your .gitignore : ... Other useful commands can also be found in this link.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It seems like the question is whether we decide to ignore files based on the path which is provided by the user (current behavior), or whether we decide to ignore files based on the realpaths of the files provided by the user (requested behavior).
Personally, the current behavior seems more expected to me. If a symlink exists in a directory I’m linting, I would expect ESLint to follow that symlink and lint whatever it finds, regardless of where the realpath of the file exists.
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.