💼 This rule is enabled in the following configs: ☑️ flat/recommended
, 🟢 flat/recommended-module
, ✅ flat/recommended-script
, ☑️ recommended
, 🟢 recommended-module
, ✅ recommended-script
.
If an import
declaration's source is extraneous (it's not written in package.json
), the program works in local, but will not work after dependencies are re-installed. It will cause troubles to your team/contributors.
This rule disallows import
declarations of extraneous modules.
This rule warns import
declarations of extraneous modules.
{
"rules": {
"n/no-extraneous-import": ["error", {
"allowModules": [],
"resolvePaths": []
}]
}
}
This can be configured in the rule options or as a shared setting settings.allowModules
.
Please see the shared settings documentation for more information.
This can be configured in the rule options or as a shared setting settings.resolvePaths
.
Please see the shared settings documentation for more information.
This can be configured in the rule options or as a shared setting settings.convertPath
.
Please see the shared settings documentation for more information.