Skip to content

imports rules

Validate the imports field in package.json — condition ordering, pattern matching, and format checks.

Rules (6)

RuleDescriptionSeverityFixable
default-lastCheck that "default" is the last key in imports condition maps🔴 error🔧
module-esm-onlyCheck that "module" condition in imports points to ESM content🟡 warning
module-before-requireCheck that "module" comes before "require" in imports condition maps🟡 warning🔧
fallback-arrayWarn against fallback arrays in imports🟡 warning
glob-matched-filesValidate that wildcard patterns in imports match at least one file🟡 warning
no-deprecated-subpathWarn on trailing "/" in imports keys (use /* instead)🟡 warning

Released under the MIT License.