vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 402 forks source link

`vue-tsc --fix` for CLI bulk auto-fixes (like you can do one at a time inside VSCode) #4999

Open justingrant opened 1 week ago

justingrant commented 1 week ago

What problem does this feature solve?

It saves developers huge amounts of time when fixing large numbers of lint issues in .vue files.

Vue integration with VSCode makes it easy to auto-fix problems that are auto-fixable. It'd be great to have this capability available on the vue-tsc CLI as well, because when upgrading TS, other dependencies, or TS configs you'll often get hundreds of auto-fixable problems in a large codebase, and it's inefficient and error prone to fix these one at a time in the IDE. I know this because I just auto-fixed 200+ import => import type in the IDE and it took a long time and hundreds of mouse clicks.

What does the proposed solution look like?

Here's an example CLI tool that does this with regular TSC: https://github.com/microsoft/ts-fix

It'd be great if there were a similar capability for Vue tools, e.g. vue-tsc --fix just like there's npx eslint . --fix.

Also, the VSCode integration should expose a command in the extension like vscode-eslint's:

image