Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: deduplicate exports #218

Open
ntnyq opened this issue Dec 23, 2024 · 0 comments
Open

Feature: deduplicate exports #218

ntnyq opened this issue Dec 23, 2024 · 0 comments

Comments

@ntnyq
Copy link

ntnyq commented Dec 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant