-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
Node.js API should allow fixing a list of files in-place #7684
Labels
status: needs discussion
triage needs further discussion
Comments
@jeff-held-aiven The combination of |
Demo
import stylelint from 'stylelint';
await stylelint.lint({
files: ['test.css'],
config: { rules: { 'hue-degree-notation': 'angle' } },
fix: true,
}); Run: $ cat test.css
a {
color: hsl(198 28% 50%);
}
$ node test.mjs
$ cat test.css
a {
color: hsl(198deg 28% 50%);
}
$ npx stylelint -v
16.5.0 Diff: --- a/test.css
+++ b/test.css
@@ -1,3 +1,3 @@
a {
- color: hsl(198 28% 50%);
+ color: hsl(198deg 28% 50%);
} |
Hm, that seems to work now, and I don't know what I was doing wrong. Thanks for the help! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the problem you're trying to solve?
I'm trying to use Stylelint's Node.js API to format my SCSS files programmatically. I can see that I can specify the
fix
option when callinglint
, but this seems to be useful only if you passcode
tolint
(as shown in the docs). What I instead want to do is the following:What solution would you like to see?
I would like to be able to do what I described, similar to what ESLint allows.
The text was updated successfully, but these errors were encountered: