For example, I'm looking to limit the usage of importing react-use
, while still permitting react-use/lib/usePrevious
. I attempted this:
rules: {
'no-restricted-imports': [2, { patterns: [
'react-use',
] }],
},
As well as:
rules: {
'no-restricted-imports': [2, { patterns: [
'react-use',
'!react-use/*',
] }],
},
But in both scenarios, I encounter an error with:
import usePrevious from 'react-use/lib/usePrevious';
I specifically want the error to trigger only for:
import something from 'react-use';