sweepline / eslint-plugin-unused-imports

Package to separate no-unused-vars and no-unused-imports for eslint as well as providing an autofixer for the latter.
MIT License
504 stars 21 forks source link

Remove unused imports not happening on save #97

Closed DanPatten closed 1 month ago

DanPatten commented 1 month ago

My eslint config:

`

    "no-unused-vars": "off", // no-unused-imports handles this
    "@typescript-eslint/no-unused-vars": "off", // no-unused-imports handles this
    "@typescript-eslint/no-unused-imports": "off", // no-unused-imports handles this
    "unused-imports/no-unused-imports": "error",
    "unused-imports/no-unused-vars": [
        "error",
        {
            vars: "all",
            varsIgnorePattern: "^_",
            args: "after-used",
            argsIgnorePattern: "^_",
            ignoreRestSiblings: true,
        },
    ],

`

Now in my app.code-workspace in VS Code I have this set

"editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" },

However this plugin does not remove unused imports on save. If I run eslint fix on the file it works fine.

antfu commented 1 month ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required