Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

This is turning off too much I think #96

Closed
ThiefMaster opened this issue May 15, 2020 · 11 comments · Fixed by #125
Closed

This is turning off too much I think #96

ThiefMaster opened this issue May 15, 2020 · 11 comments · Fixed by #125

Comments

@ThiefMaster
Copy link

For example, by disabling the default for rule-empty-line-before (coming from stylelint-config-standard), this CSS is accepted:

.a {
  color: #fff;
}
.b {
  color: #000;
}

But prettier has no opinion on this, so a useful rule for readability gets disabled, which would otherwise reformat to this:

.a {
  color: #fff;
}

.b {
  color: #000;
}
@EvgenyOrekhov
Copy link

Is it possible to configure rule-empty-line-before in a way that would conflict with Prettier? If yes, then it's OK that it is getting disabled. BUT, it would be great to have a "Special rules" section in the README, like the one eslint-config-prettier has, that would have a list of rules that could be re-enabled.

@shannonmoeller
Copy link
Member

shannonmoeller commented Jun 4, 2020

I admit I haven't gone over each rule with a fine-toothed comb. If this is causing problems and prettier has no opinion, I'm happy for it to be removed. PR welcome. I'd rather not have to configure configs with more configs if we can avoid it. :)

@EvgenyOrekhov
Copy link

Found another one that could be used with Prettier: at-rule-empty-line-before.

It is also included in stylelint-config-standard.

@tuan-lm97
Copy link

Look like this repo haven't been maintain much although it have been official recommended by prettier ?
There are many rules that had not been turn off properly and some rule turned off for no good reason.

@JustFly1984
Copy link

Can somebody confirm if this package is still maintained?

@shannonmoeller
Copy link
Member

I created this package, but haven't had time to maintain it lately. So sorry. I'm happy to accept any PRs with details about which rules are being modified and why.

@shannonmoeller
Copy link
Member

PR #125 was opened to modify some rules. Pinging this thread to see if other have recommendations for changes before merging and releasing as a new major version bump in one week.

@rynpsc
Copy link
Contributor

rynpsc commented Sep 21, 2021

I've taken a look at all of the existing rules and have come up with:

  • Remove at-rule-empty-line-before, Prettier has no rules for empty lines
  • Remove rule-empty-line-before, Prettier has no rules for empty lines
  • Add selector-attribute-operator-space-after, Prettier removes spaces
  • Add selector-attribute-operator-space-before, Prettier removes spaces

All other rules appear to be valid. The final list would be:

module.exports = {
  rules: {
    'at-rule-name-case': null,
    'at-rule-name-newline-after': null,
    'at-rule-name-space-after': null,
    'at-rule-semicolon-newline-after': null,
    'at-rule-semicolon-space-before': null,
    'block-closing-brace-empty-line-before': null,
    'block-closing-brace-newline-after': null,
    'block-closing-brace-newline-before': null,
    'block-closing-brace-space-after': null,
    'block-closing-brace-space-before': null,
    'block-opening-brace-newline-after': null,
    'block-opening-brace-newline-before': null,
    'block-opening-brace-space-after': null,
    'block-opening-brace-space-before': null,
    'color-hex-case': null,
    'declaration-bang-space-after': null,
    'declaration-bang-space-before': null,
    'declaration-block-semicolon-newline-after': null,
    'declaration-block-semicolon-newline-before': null,
    'declaration-block-semicolon-space-after': null,
    'declaration-block-semicolon-space-before': null,
    'declaration-block-single-line-max-declarations': null,
    'declaration-block-trailing-semicolon': null,
    'declaration-colon-newline-after': null,
    'declaration-colon-space-after': null,
    'declaration-colon-space-before': null,
    'function-comma-newline-after': null,
    'function-comma-newline-before': null,
    'function-comma-space-after': null,
    'function-comma-space-before': null,
    'function-max-empty-lines': null,
    'function-parentheses-newline-inside': null,
    'function-parentheses-space-inside': null,
    'function-whitespace-after': null,
    'indentation': null,
    'linebreaks': null,
    'max-empty-lines': null,
    'max-line-length': null,
    'media-feature-colon-space-after': null,
    'media-feature-colon-space-before': null,
    'media-feature-name-case': null,
    'media-feature-parentheses-space-inside': null,
    'media-query-list-comma-newline-after': null,
    'media-query-list-comma-newline-before': null,
    'media-query-list-comma-space-after': null,
    'media-query-list-comma-space-before': null,
    'no-empty-first-line': null,
    'no-eol-whitespace': null,
    'no-extra-semicolons': null,
    'no-missing-end-of-source-newline': null,
    'number-leading-zero': null,
    'number-no-trailing-zeros': null,
    'property-case': null,
    'selector-attribute-brackets-space-inside': null,
    'selector-attribute-operator-space-after': null,
    'selector-attribute-operator-space-before': null,
    'selector-attribute-quotes': null,
    'selector-combinator-space-after': null,
    'selector-combinator-space-before': null,
    'selector-descendant-combinator-no-non-space': null,
    'selector-list-comma-newline-after': null,
    'selector-list-comma-newline-before': null,
    'selector-list-comma-space-after': null,
    'selector-list-comma-space-before': null,
    'selector-max-empty-lines': null,
    'selector-pseudo-class-case': null,
    'selector-pseudo-class-parentheses-space-inside': null,
    'selector-pseudo-element-case': null,
    'string-quotes': null,
    'unicode-bom': null,
    'unit-case': null,
    'value-list-comma-newline-after': null,
    'value-list-comma-newline-before': null,
    'value-list-comma-space-after': null,
    'value-list-comma-space-before': null,
    'value-list-max-empty-lines': null,
  },
};
  

@shannonmoeller
Copy link
Member

Thank you, @rynpsc! Feel free to update #125 with these changes.

@JSW888
Copy link

JSW888 commented Oct 6, 2021

Any ETA on merging #125?

@shannonmoeller
Copy link
Member

Released as v9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants