Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

New rule idea: disallow form elements missing .form-control class #369

Open
ChrisMBarr opened this issue Mar 23, 2016 · 4 comments
Open

Comments

@ChrisMBarr
Copy link
Contributor

In the projects I work on, some developers just forget to add the form-control class on some elements, which cause these to look different than other elements. I would love a rule that required this class on the appropriate elements.

Similarly it would require that radio buttons & checkboxes be structured properly as
.radio > label > input[type='radio'] or label.radio-inline > input[type='radio']
and
.checkbox > label > input[type='checkbox'] or label.checkbox-inline > input[type='checkbox']

I'd be happy to write this rule and submit a PR, but I fist just wanted to check to see if this would even be a good idea at all.

@cvrebert
Copy link
Collaborator

cvrebert commented Apr 6, 2016

@ChrisMBarr I would gladly accept a PR for such a linter, with the caveat that it be disabled by default so that folks who've opted not to go "full Bootstrap" on their webpages don't get spurious warnings.

@ChrisMBarr
Copy link
Contributor Author

@cvrebert yes for sure! How would a rule be disabled by default? Would it just have to have it's ID listed as being disabled?

@cvrebert
Copy link
Collaborator

cvrebert commented Apr 7, 2016

We don't currently have a proper infrastructure for disabled-by-default rules, but it'd be reasonably straightforward to add.
I'm willing to meet you halfway. If you PR your rule as a normal linter, I'd be happy to implement the disabled-by-default logic part.

@ChrisMBarr
Copy link
Contributor Author

@cvrebert ok done! Check out PR #373!

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

No branches or pull requests

2 participants