-
-
Couldn't load subscription status.
- Fork 1.5k
Closed
Labels
Description
Repro:
// foo.ts
export const foo = "foo"
// index.ts
async function test() {
const { foo } = await import("./foo")
const foo2 = await import("./foo").then(mod => mod.foo)
const mod = await import("./foo") // should mark all non-type exports as used
}My specific use case is:
import { lazy } from "react"
const Foo = lazy(() => import("./Foo"))exported declaration 'foo' not used within other modules
Config:
{
"extends": [
"plugin:import/recommended",
"plugin:import/typescript",
// and more ...
],
"rules": {
"import/no-unused-modules": ["error", { "unusedExports": true }],
},
}Versions:
@typescript-eslint/parser: 4.8.0
eslint: 7.13.0
eslint-plugin-import: 2.22.1
andreslemusm and silverwind