Someone in my team uses vim, but the rest of us use VSCode's default formatter (i.e. vscode.typescript-language-features
). I'd like to add a git precommit hook or something that invokes the formatter without opening up the app.
See also:
Someone in my team uses vim, but the rest of us use VSCode's default formatter (i.e. vscode.typescript-language-features
). I'd like to add a git precommit hook or something that invokes the formatter without opening up the app.
See also:
There is a great git hooks tool called Husky and its documentation can be found here.
Here is an example of it inside of a package.json
file that uses pretty-quick to execute prettier whenever a git pre-commit
is executed.
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
....
I find this method far superior to running prettier on every file save.
As of July 2021, it seems vscode does not provide any way to run its formatter outside of the app itself