Incorrect autofix for Sass indented mixins
See original GitHub issueWhat steps are needed to reproduce the bug?
- Run stylelint on file containing mixin.
- The mixin line is gone
Sample file:
// assets/stylesheets/components/alerts.sass
.alert__undo
background: #33343A !important
height: 80px
.error-alert
+box-shadow($box-shadow)
border-color: $error-darker
margin: $m-sm auto
width: 50%
span
color: $error-darker
display: flex
font-weight: 500
justify-content: space-between
line-height: $m-base
What Stylelint configuration is needed to reproduce the bug?
{
"extends": [
"stylelint-config-prettier",
"stylelint-config-recommended-scss",
"stylelint-config-standard",
],
"customSyntax": "postcss-sass",
"plugins": [
"stylelint-order",
"stylelint-scss"
],
"rules": {
"indentation": 2,
"order/properties-alphabetical-order": true
}
}
How did you run Stylelint?
yarn stylelint 'assets/stylesheets/*.sass' --fix --custom-syntax
Which version of Stylelint are you using?
^14.11.0
What did you expect to happen?
I expect the file to keep the +box-shadow($box-shadow)
line after stylelint is run
What actually happened?
The mentioned line is removed from the file.
Does the bug relate to non-standard syntax?
SASS
Proposal to fix the bug
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
indentation is not auto fixed · Issue #18 · srowhani/sass-lint ...
I am searching a solution to fix bad indentation in my scss files and i thought that sass-lint-auto-fix was made for that. But...
Read more >Syntax
The indented syntax supports all the same features as SCSS, but it uses indentation instead of curly braces and semicolons to describe the...
Read more >stylelint-config-sass-guidelines - npm package
Simply add a "rules" key to your config and add your overrides there. For example, to change the indentation to tabs and turn...
Read more >How can i fix the css stylelint errors caused by sass / scss?
I have used various sass linting options like sass-lint and sass-lint-auto-fix but these options, though helpful, have not fixed the problems in ...
Read more >Changelog
Added: declaration-block-no-duplicate-properties autofix (#6296) (@fpetrakov). ... Fixed: indentation false positives for Less parametric mixins with rule ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bartoszmaka Thanks for the report. @ybiquitous Thanks for digging into the issue.
We removed built-in support for non-standard syntaxes in
14.0.0
for precisely this reason. Non-standard syntaxes are maintained by their respective communities and syntaxes will fade away if the health of the community isn’t good. We can close the issue as it isn’t related to Stylelint itself. @bartoszmaka If you have time, I suggest contributing to the upstream parsers if you wish to continue using Sass with Stylelint.Unfortunately,
postcss-sass
andgonzales-pe
internally used bypostcss-sass
seems not to be actively maintained. 😓