ast-grep-vscode
ast-grep-vscode copied to clipboard
Rewrite code on file save
Discussed in https://github.com/ast-grep/ast-grep/discussions/829
Originally posted by AlexeyDuybo January 1, 2024 Hi, is it possible to rewrite the code, according with the "fix" option in the rules, when saving the file? I use vscode extension but it doesnt rewrite the files on save
Here is some eslint-related information as an entry point for our investigation
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
In addition, we should try to avoid ast-grep as the default formatter, the most commonly used method of ast-grep should be used as a supplement to the formatter rather than being a formatter. Maybe our goal is to let eslint, prettier etc can work together when saving