Skip to content

format-mismatch

Check that export file contents match the expected module format

PropertyValue
Rule IDexports/format-mismatch
Categoryexports
Severity🟡 warning
FixableNo

What it Checks

Detects when a file claimed as ESM (via "import" condition) actually contains CommonJS syntax (module.exports), or vice versa.

Configuration

Disable this rule:

bash
tspub check --ignore-rules "exports/format-mismatch"

Or in tspub.config.ts:

typescript
export default {
  check: {
    severityOverrides: {
      "exports/format-mismatch": "off",  // or "warning", "error", "info"
    },
  },
};

Released under the MIT License.