Eslint-plugin-import: no-unused-modules does not consider exported TypeScript interfaces, types and enums

Created on 9 Mar 2020  路  3Comments  路  Source: benmosher/eslint-plugin-import

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.

help wanted typescript

Most helpful comment

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

All 3 comments

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

is there a workaround for files that only export interfaces?

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

Was this page helpful?
0 / 5 - 0 ratings