-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 packages/stylelint-plugin & initial rule to prevent raw values #16924
Conversation
Why not just add the stylelint For the most part it looks like these changes would be good for WP Core also. |
my intention was to introduce more custom rules with time (things like accessibility checks, custom checks on complex values or checks that are logical for Gutenberg) that are ready to use plugin didn't provide. do you think I should refactor this to be used directly inside the top level as for not adding it directly to what do you suggest? |
I think it's the right opportunity to move |
Probably worth having a discussion in #core-js about this, might be a bit late for this weeks dev chat that is about to occur though. For what its worth I also plan on moving We can add a custom config to If needed we can add more rules and plugins such as If new stylelint plugins are to be created we should create a new package for each, eg, ———— After rereading the above I think adding P.s. stylelint is always spelled entirely in lowercase |
Yeah, it would be great to have everything colocated as we already have it for ESLint, Browserslist or Babel 👍 |
With #27810 landed – |
so good to close this? |
I don't know whether it contains any of the changes proposed for enabled rules in this PR. The package itself is now maintained in the monorepo. |
I think my previous comment above would still be somewhat related, we can add the This PR could be adapted for that, but maybe a new PR would be a little cleaner and easier, up to you @senadir |
Let's close this issue and reopen it again if necessary. 🙏 |
Description
after some initial talking with @jasmussen we had the idea to try stricter rules in the SCSS codebase.
This PR is a proposal toward a cleaner, less error-prone SCSS codebase.
it introduce a stylelint plugin for a basis to create new rules & extend existing rules.
the first rule it adds is declaration-strict-value and it prohibits the use of raw values in
color
,border-color
,background
,z-index
, so things like this are not validhowever, those are valid:
however, this only PR only add the detecting but doesn't fixes anything yet, there are 111 violation, not all of them are correct, but most of them are, if you want to ignore a violation you can turn off the rule.
what I would really appreciate is some help into fixing all of those issues, it's going to take some time to finish them all so feel free to push to this branch.
How has this been tested?
run
npm install
to install the new dependencies.run
npm run lint-css
to see the new problems.Screenshots
Checklist: