Skip to content

imports/module-esm-only

Check that "module" condition in imports points to ESM content

PropertyValue
Rule IDimports/module-esm-only
Categoryimports
Severity🟡 warning
FixableNo

What it Checks

The "module" condition is intended for ESM-aware bundlers. When it points to a CommonJS file, bundlers may fail to tree-shake or process the import correctly.

Configuration

Disable this rule:

bash
tspub check --ignore-rules "imports/module-esm-only"

Or in tspub.config.ts:

typescript
export default {
  check: {
    severityOverrides: {
      "imports/module-esm-only": "off",  // or "warning", "error", "info"
    },
  },
};

Released under the MIT License.