Skip to content

Instantly share code, notes, and snippets.

@jeremy-code
Created August 8, 2026 04:31
Show Gist options
  • Select an option

  • Save jeremy-code/955c40ddb19c912827d023174f286587 to your computer and use it in GitHub Desktop.

Select an option

Save jeremy-code/955c40ddb19c912827d023174f286587 to your computer and use it in GitHub Desktop.
eslint-plugin-import-x quick fixes for false positive warnings

Default export misidentified as named type export

// Using exported name 'DOMPurify' as identifier for default export. (import-x/no-named-as-default)
import DOMPurify from "dompurify"; // DOMPurify's exported name is a type, not the default export
import { default as DOMPurify } from "dompurify";

Default export used intentionally as namespace

import tseslint from "typescript-eslint";

export default [
  // Caution: `tseslint` also has a named export `configs`. Check if you meant to write `import {configs} from 'typescript-eslint'` instead. (import-x/no-named-as-default-member)
  tseslint.configs.recommendedTypeChecked,
]

Clearly, import { configs } from "typescript-eslint" would only be more confusing in an ESLint file rather than less. In which case, use a namespaced export:

import * as tseslint from "typescript-eslint";

export default [
  tseslint.configs.recommendedTypeChecked,
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment