microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

editor.codeActionsOnSave with "source.organizeImports", "source.fixAll" not always applied #51

Closed mjbvz closed 5 years ago

mjbvz commented 5 years ago

From https://github.com/Microsoft/vscode/issues/67482

Repo

  1. In VS Code, set:
  "editor.codeActionsOnSave": {
            "source.organizeImports": true,
            "source.fixAll": true
        }
  1. Try saving a file with imports and tslint fixable problems (such as missing semicolons)

Bug Fix all is often not run on save

See https://github.com/Microsoft/vscode/issues/67482#issuecomment-458765199 for explanation of root cause

Kjagd commented 5 years ago

Related:

Due to the change of applying fixAll first (https://github.com/Microsoft/vscode/commit/f0d1dbcd2c976ce9e7d845d01a61992b6a5f2d5f), I'm having issues with the output of organizeImports being formatted differently (disrespecting line length, and adding semicolons). While it would be nice if the organize action was following the same linting rules, in this case I would like fixAll to run last.

unindented commented 5 years ago

I have the exact same issue as @Kjagd. organizeImports and tslint have a different idea of what the imports should look like.

mjbvz commented 5 years ago

Should be fixed in extension version 1.2.0

maiasmith commented 5 years ago

This still seems to be an issue, even with extension version 1.2.0.

Maximaximum commented 5 years ago

The issue is still relevant. @mjbvz could you please reopen it?