Import NextRules
prefer-tree-shakeable-imports
Prefer import patterns that enable effective tree-shaking
š¼ This rule is enabled in the following configs: recommended, typescript.
š” This rule is automatically fixable by the --fix CLI option.
Prefer import patterns that enable effective tree-shaking
Rule Details
This rule aims to prevent issues related to prefer-tree-shakeable-imports.
Options
[
{
"type": "object",
"properties": {
"targetPackages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"subpathPattern": {
"type": "string"
},
"preferNamed": {
"type": "boolean"
}
},
"required": [
"name"
]
},
"default": [],
"description": "Packages to enforce tree-shakeable imports"
},
"blockAllNamespaceImports": {
"type": "boolean",
"default": false,
"description": "Block all namespace imports"
}
},
"additionalProperties": false
}
]Implementation
OWASP Foundation
- Category: A00:2021 - General Security