Skip to content
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

Ideas for new rules #7

Open
mik01aj opened this issue Sep 28, 2016 · 3 comments
Open

Ideas for new rules #7

mik01aj opened this issue Sep 28, 2016 · 3 comments

Comments

@mik01aj
Copy link
Contributor

mik01aj commented Sep 28, 2016

I'll just throw some ideas in like I did in one other plugin - the plugin could:

  • check that the each file contains just one toplevel block
  • check that every toplevel selector (might be just one, see above) matches the file name (e.g. I have .cool-thing { ... } in things/cool-thing/style.scss. I mean, every toplevel selector in that file should contain cool-thing. E.g. .cool-thing-floating-menu would be ok too.
  • check that a component doesn't modify other components' stuff, e.g. .cool-thing > .other-thing > .that should be illegal
  • for selectors containing a component class (possibly with a variant) check that there are no positioning properties (position, floats, margins, maybe dimensions)
@rstacruz
Copy link
Owner

Number 3 should already be taken care of. :) Thanks for the suggestions!

On Wed, Sep 28, 2016, 8:36 PM Mikołaj D. [email protected] wrote:

I'll just throw some ideas in like I did in one other plugin
wix-incubator/eslint-plugin-lodash#4 - the plugin could:

  • check that the each file contains just one toplevel block
  • check that every toplevel selector (might be just one, see above)
    matches the file name (e.g. I have .cool-thing { ... } in
    things/cool-thing/style.scss. I mean, every toplevel selector in that
    file should contain cool-thing. E.g. .cool-thing-floating-menu would
    be ok too.
  • check that a component doesn't modify other components' stuff, e.g. .cool-thing

    .other-thing > .that should be illegal

  • for selectors containing a component class (possibly with a variant)
    check that there are no positioning properties (position, floats, margins,
    maybe dimensions)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEikVl3uL2mq1Fg7aN7j95wGUwcYQl2ks5qul80gaJpZM4KIxCh
.

@mik01aj
Copy link
Contributor Author

mik01aj commented Sep 29, 2016

A ha! So the class-format rule actually does much more than I thought :)

@mik01aj
Copy link
Contributor Author

mik01aj commented Sep 30, 2016

One more:

  • disallow + and ~ selectors. To avoid .my-component + .other-component selectors. And maybe it's even a good idea to disallow them everywhere, they are confusing.

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

No branches or pull requests

2 participants