Skip to content

Feature: deduplicate exports #218

Open
@ntnyq

Description

@ntnyq

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions