eslint-plugin-import-x icon indicating copy to clipboard operation
eslint-plugin-import-x copied to clipboard

Feature: deduplicate exports

Open ntnyq opened this issue 11 months ago • 0 comments

ESLint config

// eslint.config.mjs
import { config, configs  } from 'typescript-eslint'
import pluginImportX from 'eslint-plugin-import-x'

export default config({
  extends: [configs.recommended],
  plugins: {
    'import-x': pluginImportX
  },
  rules: {
    'import-x/no-duplicates': 'error',
    'import-x/export': 'error'
  }
})

Code

// foo.ts

export const foo = 'bar'
export const bar = 'foo'
export * from './foo'
export * from './foo'

export { foo } from './foo'
export { bar } from './foo'

Expect behavior

  1. report user to delete one export * from './foo'
  2. report user to merge named export from same module. Like import-x/no-duplicates does for import statement

Current behavior

Nothing.

ntnyq avatar Dec 23 '24 15:12 ntnyq