Skip to content

imports/default-last

Check that "default" is the last key in imports condition maps

PropertyValue
Rule IDimports/default-last
Categoryimports
Severity🔴 error
Fixable🔧 Auto-fixable (safe)

What it Checks

Node.js processes import conditions top-to-bottom. "default" is a catch-all -- if it appears before specific conditions like "import" or "require", those conditions are unreachable.

Configuration

Disable this rule:

bash
tspub check --ignore-rules "imports/default-last"

Or in tspub.config.ts:

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

Released under the MIT License.