-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 ESLint rule to prevent usage of the order CSS property #61247
Comments
I guess the patterns to catch would be, at least, the following ones. With and without leading spaces or tab characters:
|
Hey, I'm fairly new to open-source and web development, but I would love to give it a try |
@ghostp13409 welcome. Sure, please do feel free to work on a Pull Request. I did try to follow a previous example that added another ESLint rule, see #59022. But I'm not good at regular expressions. Also, I have no idea how that works. I did try to go through the ESLint custom rules docs and the docs for selectors but this isn't really my area of expertise. Wondering if there's any simpler way to detect the It gets complicated because of the several ways CSS can be coded in JS. It could be a key/value pair within an object, or a string, or a concatenated string... etc. Note the JS linter can be run in the terminal with this command: |
CSS-in-JS can either be done with strings or objects. The string case can be caught similar to #59022 without much downside, but the object case will be trickier because I wouldn't say this rule is particularly necessary at the moment, given that:
Might be fine to revisit once we actually encounter an |
Hey @afercia , I think i can solve this issue....Can i make a pull request? |
Description
See #61241
Some components come with CSS in JS.
#61241 and #61243 aim to introduce a
stylelint
rule to prevent usage of theorder
CSS property, which is impactful for accessibility.In the same way, it would be nice to add an ESLint rule to prevent usage of the
order
CSS property in any *.js file.Unfortunately this isn't exactly my area of expertise so that I'd appreciate some guidance. I did see a similar rule added in #58130
Step-by-step reproduction instructions
order
CSS property e.g.order: 1;
to any CSS-in-JS for example in this file..npm run lint:js
.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: