-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Omrisnyk/npm-lockfiles
#130Labels
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 incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Tell us about your environment
- ESLint Version:
v5.15.3(but the same happens onv5.16.0as well) - Node Version:
v8.15.1 npmYarn Version:1.15.2
What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser but it's reproducible with the default one as well
Please show your full configuration:
Configuration
{
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash-es",
"importNames": ["anything"],
"message": "Custom message"
}
]
}
],
}
}
}What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
import * as _ from 'lodash-es';eslint path/to/my/file.jsWhat did you expect to happen?
The provided message should be printed.
What actually happened? Please include the actual, raw output from ESLint.
The custom message is not printed, only the default one:
* import is invalid because 'anything' from 'lodash-es' is restricted
This behavior is even validated by tests. As you can see, the message field is specified but it's not used in the output.
Are you willing to submit a pull request to fix this bug?
Yes
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 incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules