bootlint
bootlint copied to clipboard
New rule idea: disallow form elements missing .form-control class
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.
@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.
@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?
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.
@cvrebert ok done! Check out PR #373!