-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example
Description
- ESLint Version: 7.23.0
- Node Version: 15.4.0
- npm Version: 7.1.1
- Operating System: linux 5.4.0-70-generic
- Parser: @babel/eslint-parser
Configuration
module.exports = {
root: true,
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2018,
sourceType: 'module'
},
extends: [
'standard',
'plugin:vue/recommended'
],
plugins: ['vue'],
rules: {
'max-len': ['warn', { code: 120 }],
'vue/no-v-html': 'off'
}
}
ESLint CLI usage:
eslint --cache --ext .js,.vue --max-warnings 0
What did you expect to happen?
I expected to have and error in console: 'patterns' must be a non-empty string or an array of non-empty strings
.
Instead, I got no response at all (and no actual linting performed, of course).
$ eslint --cache --ext .js,.vue --max-warnings 0
Done in 0.23s.
How to replicate?
- Run
eslint
CLI with no positional parameters. - No error is shown .
More details
The condition in ESLint engine code is accepting an empty list as a valid list of non empty strings. It boils down to the fact that a call to .every(...)
method of an empty list is always true (see isArrayOfNonEmptyString
function)
I'm more than OK to prepare a PR to fix this.
Thanks!
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example