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

no-unused-modules does not consider exported TypeScript interfaces, types and enums #1680

Closed
felixfbecker opened this issue Mar 9, 2020 · 3 comments · Fixed by #1819
Closed

Comments

@felixfbecker
Copy link

felixfbecker commented Mar 9, 2020

export interface Foo {}

with

module.exports = {
  extends: [
	'plugin:import/errors',
    'plugin:import/warnings',
    'plugin:import/typescript',
  ],
  rules: {
    'import/no-unused-modules': ['error', { missingExports: true }],
  }
}

produces No exports found error by import/no-unused-modules.

Expected:
No error.

@ljharb
Copy link
Member

ljharb commented Mar 10, 2020

Seems like we'll have to handle files that only export types.

@boredland
Copy link

is there a workaround for files that only export interfaces?

@ljharb
Copy link
Member

ljharb commented Jun 10, 2020

Given that an interface is a type, that would be the sole task this issue needs help with :-)

ljharb added a commit to nicolashenry/eslint-plugin-import that referenced this issue Jun 11, 2020
…ypes and enums

Fixes import-js#1680

Co-authored-by: e020873 <nicolas.henry-partner@arcelormittal.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@ljharb ljharb closed this as completed in 54eb51b Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants