depracetd old seeting suggestions.ignoreAutoImports" and extend it to `suggestions.autoImports":
"suggestions.autoImports": [
{
"modules": ["path"], // ignore path, but not path/posix or path/win32 modules,
"members": []
}
{
"modules": ["next-nprogress-bar"],
"excludeMembers": ["useRouter"] // will exclude useRouter from next-nprogress-bar
},
{
"modules": ["@mui/material"],
"excludeMembers": ["SxProps"] // will exclude type SxProps from @mui/material
},
{
"modules": ["@mui/system"],
"members": ["SystemCssProperties"], will exclude all other members except for `SystemCssProperties`
}
]
I use
next-nprogress-bar
in my next.js project, but ts will sometimes importuseRouter
fromnext-nprogress-bar
which is not my expected:Solution
depracetd old seeting
suggestions.ignoreAutoImports"
and extend it to `suggestions.autoImports":Maybe you can get some inspiration from https://eslint.org/docs/latest/rules/no-restricted-imports