ESLint rule to allow for multiple severities to be used for no-restricted-imports.
Discussed in this issue: eslint/eslint#14061
In your .eslintrc.js
file:
- add
'no-restricted-imports-clone
to theplugins
array. - add the following the
rules
object:
'no-restricted-imports': [
'error',
{
name: 'someDependency',
message: "Don't import someDependency.",
},
],
'no-restricted-imports-clone/no-restricted-imports-clone': [
'warn',
{
name: 'anotherDependency',
message: "You are encouraged to not import anotherDependency.",
},
],