Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite code on file save #67

Open
HerringtonDarkholme opened this issue Jan 1, 2024 · 1 comment
Open

Rewrite code on file save #67

HerringtonDarkholme opened this issue Jan 1, 2024 · 1 comment

Comments

@HerringtonDarkholme
Copy link
Member

Discussed in ast-grep/ast-grep#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

@HerringtonDarkholme HerringtonDarkholme transferred this issue from ast-grep/ast-grep Jan 1, 2024
@SoonIter
Copy link
Member

SoonIter commented Feb 14, 2024

Here is some eslint-related information as an entry point for our investigation

image
  "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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants