Skip to content

extensions rule autofix "fixes" imports to files that don't actually exist #413

@hackel

Description

@hackel

I'm running with

'import-x/extensions': ['error', 'ignorePackages', { fix: true }],

I have many index imports to files like e.g. /api/index.js which are currently imported as import '@/api'. When I run the fixer, it changes them to import '@/api.js' instead of @/api/index.js which causes my app to blow-up. I don't know if the fixer is attempting to actually resolve the files or not, and maybe this is outside the scope of this rule, but I don't think it should be auto-fixing at all if it can't be certain that it is a correct fix.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions