bootlint icon indicating copy to clipboard operation
bootlint copied to clipboard

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

Open ChrisMBarr opened this issue 9 years ago • 4 comments

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 avatar Mar 23 '16 13:03 ChrisMBarr

@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 avatar Apr 06 '16 20:04 cvrebert

@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?

ChrisMBarr avatar Apr 07 '16 02:04 ChrisMBarr

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 avatar Apr 07 '16 02:04 cvrebert

@cvrebert ok done! Check out PR #373!

ChrisMBarr avatar Apr 07 '16 18:04 ChrisMBarr