imports rules
Validate the imports field in package.json — condition ordering, pattern matching, and format checks.
Rules (6)
| Rule | Description | Severity | Fixable |
|---|---|---|---|
default-last | Check that "default" is the last key in imports condition maps | 🔴 error | 🔧 |
module-esm-only | Check that "module" condition in imports points to ESM content | 🟡 warning | |
module-before-require | Check that "module" comes before "require" in imports condition maps | 🟡 warning | 🔧 |
fallback-array | Warn against fallback arrays in imports | 🟡 warning | |
glob-matched-files | Validate that wildcard patterns in imports match at least one file | 🟡 warning | |
no-deprecated-subpath | Warn on trailing "/" in imports keys (use /* instead) | 🟡 warning |