Import NextRules
prefer-default-export
Prefer a default export if module exports a single name
š¼ This rule is enabled in the following configs: recommended, typescript.
š” This rule is automatically fixable by the --fix CLI option.
Prefer a default export if module exports a single name
Rule Details
This rule aims to prevent issues related to prefer-default-export.
Options
[
{
"type": "object",
"properties": {
"target": {
"type": "string",
"enum": [
"always",
"single",
"as-needed"
],
"default": "single",
"description": "When to enforce default exports: always (all), single (single export), as-needed (when beneficial)"
},
"ignoreFiles": {
"type": "array",
"items": {
"type": "string"
},
"description": "File patterns to ignore"
},
"allowNamedExports": {
"type": "boolean",
"default": false,
"description": "Allow named exports without warnings"
}
},
"additionalProperties": false
}
]Implementation
OWASP Foundation
- Category: A00:2021 - General Security