-
-
Notifications
You must be signed in to change notification settings - Fork 934
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 stylelint-disable commands support to autofix #2643
Comments
I think it is bug, should be respected by default. |
I think it also ignore |
I know why I have no idea what to do with |
@hudochenkov maybe create util |
I came up to another problem. Disabled ranges assigned before file linted/fixed. For rules which altered lines (change empty lines, add line endings), disabled ranges might be incorrect after few fixes. Even after fixes within one rule. This problem affects every rule. Because if user has rule with fixing which changes lines, then every rule after this rule will have incorrect disabled ranges. |
@hudochenkov Thanks for digging deeper. I suspect there are going to be some significant hurdles to overcome with this issue. As such, I suggest we push on with |
Agree. We should not close this issue, to not forget about this problem.
I think we should add a note somewhere about this caveat. And suggested strategy: if user is using |
@hudochenkov can we learn how it does |
@evilebottnawi of course we can. But I have a feeling that it won't help us, because of differences in architecture and approaches. Also I remember something from discussions, when we were discussing how to do autofixing. ESLint make multiple runs until everything is fixed and violations verified. And it also has some ranges for autofixing or something, that recalculated constantly. I might be mistaken about the last one. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Stylelint also fix-breaks calc() functions as it removes units of values that need it (see stylelint/stylelint#3037). It also auto-fixes it (and hence breaks it then): stylelint/stylelint#2643, so we have to disable the whole rule for now. In order to be able to add comments to the stylelint config I moved it to a .js file.
I think it's better to work on documenting now because we may release this new |
Refactoring all the rules is done. ✅ |
FYI
|
I have a file that has
/* stylelint-disable */
/* stylelint-enable */
wrapped around it but when using--fix
it tries to format this file and breaks it quite bad.--fix
Before
After
A few of the issues:
;;
onL38
;
onL92
(I imagine this is where the;;
comes fromConfig
The config is pretty huge but i don't think it's the problem here
7.11.0
CLI through
lint-staged
declaration-block-no-duplicate-properties
function-calc-no-unspaced-operator
alpha-value-notation
at-rule-empty-line-before
at-rule-no-vendor-prefix
color-function-notation
color-hex-length
comment-empty-line-before
comment-whitespace-inside
custom-property-empty-line-before
declaration-block-no-redundant-longhand-properties
declaration-empty-line-before
font-family-name-quotes
function-name-case
function-url-quotes
hue-degree-notation
import-notation
keyframe-selector-notation
length-zero-no-unit
lightness-notation
media-feature-range-notation
media-feature-name-no-vendor-prefix
property-no-vendor-prefix
rule-empty-line-before
selector-attribute-quotes
selector-no-vendor-prefix
selector-not-notation
selector-pseudo-element-colon-notation
selector-type-case
shorthand-property-no-redundant-values
value-keyword-case
value-no-vendor-prefix
font-weight-notation
context.fix
warningno-empty-source
The text was updated successfully, but these errors were encountered: