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

Add autoFix on save #13

Closed
BPScott opened this issue Dec 5, 2019 · 0 comments · Fixed by #18
Closed

Add autoFix on save #13

BPScott opened this issue Dec 5, 2019 · 0 comments · Fixed by #18
Labels
type: enhancement a new feature that isn't related to rules

Comments

@BPScott
Copy link
Contributor

BPScott commented Dec 5, 2019

This was added in the hex-ci fork in hex-ci/vscode-stylelint-plus@66dbb72?w=1 (linking to a diff with suppressed whitespace as there's a bunch of noisy reformatting in there too), where its option name autoFixOnSave mimics the usage of the current vscode-eslint plugin.

This probably the most desired missing feature of shinnn's original work and was the reason the hex-ci fork exists. It'd be great to have autofixing in extension as it seems like this is about to become the official stylelint extension.

This would let me update the docs in the prettier vscode plugin to make it recommend this plugin once it gets published.


Longer term I note that the eslint plugin is on the cusp of releasing a v2 which changes how it registers autofixing - the autoFixOnSave option will be removed and replaced with a hook into vscode's native editor.codeActionsOnSave option (see its README). Eventually it's probably worth reworking the plugin to mimic how vscode-eslint is architected to allow for this autofixing and to ensure the plugin uses the locally installed version of stylelint if available, but that rework can be punted down the road for a while, and a stopgap autofix would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement a new feature that isn't related to rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants