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

[v1] Adapt to button changes #450

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/bootlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,12 @@ var LocationIndex = _location.LocationIndex;
}
});
*/
/*
addLinter('W007', function lintBtnType($, reporter) {
var badBtnType = $('button:not([type="submit"], [type="reset"], [type="button"])');
if (badBtnType.length) {
reporter('Found one or more `<button>`s missing a `type` attribute.', badBtnType);
}
});
*/
/*
addLinter('W008', function lintTooltipsInBtnGroups($, reporter) {
var nonBodyContainers = $('.btn-group [data-toggle="tooltip"]:not([data-container="body"]), .btn-group [data-toggle="popover"]:not([data-container="body"])');
Expand Down Expand Up @@ -532,22 +530,18 @@ var LocationIndex = _location.LocationIndex;
}
});
});
/*
addLinter('W016', function lintDisabledClassOnButton($, reporter) {
var btnsWithDisabledClass = $('button.btn.disabled, input.btn.disabled');
if (btnsWithDisabledClass.length) {
reporter('Using the `.disabled` class on a `<button>` or `<input>` only changes the appearance of the element. It doesn\'t prevent the user from interacting with the element (for example, clicking on it or focusing it). If you want to truly disable the element, use the `disabled` attribute instead.', btnsWithDisabledClass);
}
});
*/
/*
addLinter('W017', function lintInputsMissingTypeAttr($, reporter) {
var inputsMissingTypeAttr = $('input:not([type])');
if (inputsMissingTypeAttr.length) {
reporter('Found one or more `<input>`s missing a `type` attribute.', inputsMissingTypeAttr);
}
});
*/
addLinter('E001', (function () {
var MISSING_DOCTYPE = 'Document is missing a DOCTYPE declaration';
var NON_HTML5_DOCTYPE = 'Document declares a non-HTML5 DOCTYPE';
Expand Down Expand Up @@ -713,14 +707,6 @@ var LocationIndex = _location.LocationIndex;
});
*/
/*
addLinter('E016', function lintBtnToggle($, reporter) {
var badBtnToggle = $('.btn.dropdown-toggle ~ .btn');
if (badBtnToggle.length) {
reporter('`.btn.dropdown-toggle` must be the last button in a button group.', badBtnToggle);
}
});
*/
/*
addLinter('E017', function lintBlockCheckboxes($, reporter) {
var badCheckboxes = $('.checkbox').filter(function (i, div) {
return $(div).filter(':has(>label>input[type="checkbox"])').length <= 0;
Expand Down Expand Up @@ -768,20 +754,6 @@ var LocationIndex = _location.LocationIndex;
}
});
*/
/*
addLinter('E021', function lintButtonsCheckedActive($, reporter) {
var selector = [
'[data-toggle="buttons"]>label:not(.active)>input[type="checkbox"][checked]',
'[data-toggle="buttons"]>label.active>input[type="checkbox"]:not([checked])',
'[data-toggle="buttons"]>label:not(.active)>input[type="radio"][checked]',
'[data-toggle="buttons"]>label.active>input[type="radio"]:not([checked])'
].join(',');
var mismatchedButtonInputs = $(selector);
if (mismatchedButtonInputs.length) {
reporter('`.active` class used without the `checked` attribute (or vice-versa) in a button group using the button.js plugin', mismatchedButtonInputs);
}
});
*/
addLinter('E022', function lintModalsWithinOtherComponents($, reporter) {
var selector = [
'.table .modal',
Expand Down Expand Up @@ -1052,14 +1024,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);
}
});
*/
addLinter('E048', function lintModalRole($, reporter) {
var modals = $('.modal:not([role="dialog"])');
if (modals.length) {
Expand Down
37 changes: 0 additions & 37 deletions test/_old_fixtures/buttons-plugin/checkbox-bad.html

This file was deleted.

37 changes: 0 additions & 37 deletions test/_old_fixtures/buttons-plugin/radio-bad.html

This file was deleted.

47 changes: 0 additions & 47 deletions test/_old_fixtures/buttons-plugin/valid.html

This file was deleted.

41 changes: 0 additions & 41 deletions test/_old_fixtures/buttons/btn-toggle-after-btn.html

This file was deleted.

71 changes: 0 additions & 71 deletions test/_old_fixtures/buttons/btn-toggle.html

This file was deleted.

Loading