Skip to content

cjs-default-export

Detect CJS-only packages with only a default export and no named exports

PropertyValue
Rule IDexports/cjs-default-export
Categoryexports
Severity:blue_circle: info
FixableNo

What it Checks

CJS packages that only use module.exports = value (no named exports) can have inconsistent ESM interop. Consider adding named exports.

Configuration

Disable this rule:

bash
tspub check --ignore-rules "exports/cjs-default-export"

Or in tspub.config.ts:

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

Released under the MIT License.