eslint: Can't pass dot/hidden files on command line
Hello,
since JavaScript config files are supported now, can you please consider adding a (at least optional) way to ask eslint
to lint also hidden/dot files (e.g. .eslintrc.js
or .eslintrc.json
with the JSON plugin) if a name to a directory is passed (e.g. eslint .
)?
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 50 (38 by maintainers)
Commits related to this issue
- Fix: Allow linting of .hidden files/folders (fixes #4828) — committed to eslint/eslint by IanVS 8 years ago
- Fix: Allow linting of .hidden files/folders (fixes #4828) — committed to eslint/eslint by IanVS 8 years ago
- fix eslint warning, eslint/eslint#4828 — committed to ant-design/ant-design by afc163 8 years ago
@alberto
Yes because it was passed on the command line.
No because it wasn’t passed on the command line.
Thanks. So this looks like a bug, we should be linting anything passed on the command line. We should fix that.
He’s proposing to change
glob
options inglob-util
to make it consider dot files and folders. This won’t change anything by default since they are ignored by eslint, but it will allow unignoring them in.eslintignore
. I’m 👍 on that.Regarding my last statement above, I think this highlights a deeper problem, similar to https://github.com/eslint/eslint/issues/5547. Using
--no-ignore
should not unignore the default ignores (dependency folders and dotfiles).So to be clear, my proposal is:
--no-ignore
.Actually now that you mention that, it should already be possible, by putting
!.*
in the.eslintignore
(in 2.5.0 onward).@radek-holy, could you try that and see if it meets your need?
@radek-holy you asked for a way to pass dot files to be linted, we said you should be able to do so on the change line, but it turns out that doesn’t work. To me, everything in this issue makes sense.
@IanVS @alberto Id say let’s focus on making sure anything passed on the command line is linted. If you want to talk about maybe unignoring dot files, then a new issue is a good idea.