Description
Some context first: we use ESLint to evaluate changes to a large js codebase. When testing patches or deploying, we generate a list of changed files and run eslint on them explicitly, since running eslint across the whole codebase would be slow and unnecessary. Because of this, eslint is sometimes passed ignored files, which causes it to throw a warning (an error level we reserve for other types of errors), which causes false positives.
It seems like the answer to this problem has previously been to just run eslint on directories and to avoid lists of files or shell globs, but that doesn't quite work in this case. An option would be to just manually filter out errors like these based on text, but it seems strange that eslint outputs a warning that you can't disable, especially for something that's not an issue with code.
Note that this issue duplicates / expands upon #5623.
Tell us about your environment
- ESLint Version: 4.13.1
- Node Version: 8.9.3
- npm Version: 5.5.1
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:
Configuration
{
"env": {
"amd": true,
"browser": true,
"jquery": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"prettier",
"prettier/react"
],
"globals": {
"_": false,
"Backbone": false,
"Etsy": true,
"has": false,
"Raven": false
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"prettier"
],
"rules": {
"eqeqeq": ["error", "always"],
"no-unused-vars": ["error", {
"vars": "all",
"args": "none",
"ignoreRestSiblings": false
}],
"no-use-before-define": ["error", {
"functions": false,
"classes": true,
"variables": true
}],
"react/jsx-uses-react": ["error"],
"react/jsx-uses-vars": ["error"],
"react/prop-types": ["warn"],
"react/react-in-jsx-scope": ["error"],
"prettier/prettier": ["warn", {}]
},
"root": true,
"settings": {
"react": {
"version": "15.4.2",
"createClass": "createClass"
}
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
# modified_js_files.txt is generated from a git patch programmatically,
# and contains either ignored files or lint-free files.
cat modified_js_files.txt | xargs eslint --format checkstyle > $WORKSPACE/eslint-results.xml
What did you expect to happen?
I expected there to be no warnings
What actually happened? Please include the actual, raw output from ESLint.
There is a single warning:
/path/to/an/ignored/file.js
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
✖ 1 problem (0 errors, 1 warning)
Activity