diff options
author | Phil Hughes <phil.hughes@yoma.co.uk> | 2015-10-01 13:45:34 +0300 |
---|---|---|
committer | Chris Rebert <code@chrisrebert.com> | 2015-11-16 12:11:53 +0300 |
commit | 36d5def12416611babb1271b77e1505d7b7cc3f8 (patch) | |
tree | 34b8d808b7d04562c09204d47be19fbdc655f972 /src | |
parent | eeef4dbc300cb92ff8eab70063decde0226321f1 (diff) |
Shows an error for incorrect usage of .btn
.btn should only be used on a,button,input,label
Fixes #297
Closes #313
Diffstat (limited to 'src')
-rw-r--r-- | src/bootlint.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootlint.js b/src/bootlint.js index 30cb509..6bf7c14 100644 --- a/src/bootlint.js +++ b/src/bootlint.js @@ -1061,6 +1061,12 @@ var LocationIndex = _location.LocationIndex; reporter('`.modal` elements must have a `tabindex` attribute.', modalsWithoutTabindex); } }); + addLinter("E047", function lintBtnElements($, reporter) { + var btns = $('.btn:not(a,button,input,label)'); + if (btns.length) { + reporter('`.btn` should only be used on `<a>`, `<button>`, `<input>`, or `<label>` elements.', btns); + } + }); exports._lint = function ($, reporter, disabledIdList, html) { var locationIndex = IN_NODE_JS ? new LocationIndex(html) : null; |