E.g. I want to restrict importing react-use
, but allow react-use/lib/usePrevious
. I tried:
rules: {
'no-restricted-imports': [2, { patterns: [
'react-use',
] }],
},
And
rules: {
'no-restricted-imports': [2, { patterns: [
'react-use',
'!react-use/*',
] }],
},
However, in both case, I get an error for:
import usePrevious from 'react-use/lib/usePrevious';
I only want an error for:
import something from 'react-use';