-
-
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
Indentation autofixing #2529
Indentation autofixing #2529
Conversation
Looking good!
I think in #2259 we decided that advanced features like autofixing would only be for standard-syntax. We don't want to repeat the path of stylefmt where the project stagnated due to the quantity of non-standard bugs for this advanced feature. I think we can remove any non-standard tests and make it clear within the documentation that autofix is a standard-syntax only feature. I'm still plugging away at a |
@jeddy3 sounds reasonably, but most of our users use |
@evilebottnawi I believe, SCSS will work just fine, because parser is good. Less parser is a mess, and I have never used Less. So I'm not going to do anything for Less, but for SCSS I can do necessary changes, because I'm using it on my new job. |
@jeddy3 @hudochenkov i think we should fix only standard construction ( |
This feels like a sensible approach. |
@jeddy3 I believe that we should not touch anything what don't pass
if someone will want to use their fixes, I do not think that it will be difficult to implement |
That's very interesting, and very much aligned with our philosophy of extensibility (plugins, processors, custom syntaxes, custom formatters and shareable configs). |
/cc @davidtheclark what do you think about this idea (#2529 (comment))? |
@hudochenkov @jeddy3 maybe before |
@evilebottnawi there is no unnecessary fixes, that I'm aware of. |
@hudochenkov it is good 👍 |
@evilebottnawi: This sounds like a pain in the neck, and I doubt it would be used very often if you need different modules for each rule. |
@davidtheclark it is just idea 😄 , main thing here #2529 (comment) |
I think if we can add fixing to a rule, we should fix as much as we can. Maybe we can't do fixing for some options of a rule. It's ok, we'll show linting error as usual. Or if we can't be sure about consistency of fixing for particular options or rule, we won't add fixing, because it could be auto-breaking instead of auto-fixing. Let's return to this PR :) What should I do with part which checks code using |
@hudochenkov Run away from it 🏃♂️ 😛 If seriously we should get rid of it as much as possible where possible. |
I haven't found a way how to rewrite this rule away from style-search, because it's very complex. But I finally figured out how to add autofixing for the code that uses style-search! Less is still broken, because of semicolon bug in postcss-less. That's why tests without @stylelint/core PR is ready for a review. |
@hudochenkov i think before we should fix |
Shall we merge this and #2577, and then get out experimental support for autofixing (for standard syntax)? We're only a couple of issues away from getting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@evilebottnawi could you take a look at this PR in the next few day, please? :) |
@hudochenkov Shall we merge this? Tests look good and I think it's better we get the ball rolling on this fix stuff than wait. We're also introducing it as experimental feature. |
@jeddy3 Yeah, let's do it. |
@jeddy3 @hudochenkov: Sorry for my absence. I'm afraid my time is being consumed these days and I don't have much left to dedicate to stylelint — so please don't wait on me to make any progress! |
let's merge and release 7.11 🥇 |
Thank you for a review! Updated changelog:
For some reason Github named commit as “Create CHANGELOG.md”. |
I'm in a similar situation. When we started working on stylelint I was on a hiatus from agency work, but now my time is being consumed by non-open source work. I'm going to try to make some time to help get |
I've made autofixing for most use cases. These use cases was analyzed with PostCSS AST, so I could easily apply fixes. But for big number of other use cases this rule uses
style-search
. It's used for indentation inside declaration values, selectors, and at-rule parameters.I haven't figured out how to deal with this yet. I've commented all
reject
cases which isn't covered by current autofixing.Any suggestions how to deal with this problem?
Also there is a problem with Less syntax. I haven't investigate what causes the problem yet.
In order to finish this PR we need:
*-empty-line-before
rules with recommendation to enableindentation
ruleP. S. It was total surprise to me, that this rule has secondary options 😯
Error log with Less mixins and autofixing
Semicolon gets removed.