-
-
Notifications
You must be signed in to change notification settings - Fork 53
Closed as not planned
Labels
questionFurther information is requestedFurther information is requested
Description
Problem
The import-x/extensions
rule has a false positive on external dependencies. (Furthermore, the autofixer incorrectly "fixes" the issues, which causes run-time errors.)
Details
First, turn on the import-x/extensions
rule like this:
"import-x/extensions": [
"error",
"always",
{
fix: true,
pattern: {},
},
],
(The reason for these strange options is because the autofixer is currently bugged, so ignore that for now.)
Once the rule is turned on, the rule will error on the following code:
import { foo } from "./foo";
import { GitVersionType } from "azure-devops-node-api/interfaces/GitInterfaces";
- Erroring on the first line is correct, because "foo.ts" exists in my code and
import { foo } from "./foo.ts";
is a valid import. - However, erroring on the second line is a bug, because "GitInterfaces.ts" does NOT exist. The autofixer will change it to
import { GitVersionType } from "azure-devops-node-api/interfaces/GitInterfaces.ts";
, which will cause a run-time error.
Thus, I propose that the rule should only error on non-external dependencies.
JounQin
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested