Clarification on behavior of dot directories
See original GitHub issueTell us about your environment
- ESLint Version: v6.3.0
- Node Version: v12.8.1
- yarn Version: 1.17.3
What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser
Please show your full configuration:
Configuration
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "simple-import-sort", "prettier"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": ["error", 2],
"react/display-name": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"simple-import-sort/sort": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_$"
}]
},
"globals": {
"React": "writable"
},
"settings": {
"react": {
"version": "detect"
}
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What actually happened? Please include the actual, raw output from ESLint.
$ yarn eslint client/.storybook/config.js
.../client/.storybook/config.js
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
✖ 1 problem (0 errors, 1 warning)
What did you expect to happen?
client/.storybook/config.js
should be linted
Are you willing to submit a pull request to fix this bug?
Sure?
More details
I see this comment: https://github.com/eslint/eslint/issues/4828#issuecomment-194535273
Thanks. So this looks like a bug, we should be linting anything passed on the command line. We should fix that.
But it seems like that’s not the case, from this test suite: https://github.com/eslint/eslint/blob/22046939a7f250e6cce40a2acdfd3581a2ce29f5/tests/lib/cli-engine.js#L355-L375
The documentation doesn’t seem very helpful. Searching for “dot files” doesn’t help me, and the section on .eslintignore
only mentions:
Lines preceded by ! are negated patterns that re-include a pattern that was ignored by an earlier pattern.
Even though I’m not ignoring anything. It’s also weird that the message says File ignored because of a matching ignore pattern
because I don’t have a .eslintignore
file in my project.
The weird part is that yarn eslint client/.storybook/
works. Can we get some clarification on this issue (and the expected behavior) in the docs and/or in the CLI?
Issues that I’ve already looked at:
- https://github.com/eslint/eslint/issues/5623
- https://github.com/eslint/eslint/issues/10341
- https://github.com/eslint/eslint/issues/4828
- https://github.com/eslint/tsc-meetings/blob/430455a12366c4614f322734b38521ef12870251/notes/2018/2018-08-02.md#do-not-ignore-files-started-with--by-default
- https://github.com/eslint/eslint/issues/10597
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Hello everyone. Will be submitting a PR for this soon. Thank you for your patience. 🙂
Hello! I’d like to take a stab at this. I use ESLint a lot for work and would enjoy the opportunity to give back. Any pointers on where to focus my attention are appreciated.