Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootlint.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZac Echola <zac.echola@so.mnscu.edu>2015-04-22 23:48:22 +0300
committerChris Rebert <code@chrisrebert.com>2015-11-16 12:34:02 +0300
commitd063bba3656971ccaa207bb3056fd6b5b996bcca (patch)
tree40a047bd406001591e574f6f60bd93962ded7fa7 /src
parent36d5def12416611babb1271b77e1505d7b7cc3f8 (diff)
Adds reporter for checking children of `.input-group`
Check that `.input-group` has at least one `.form-control` and at least one of `.input-group-addon` or `.input-group-btn`. Fixes #274 Closes #275
Diffstat (limited to 'src')
-rw-r--r--src/bootlint.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bootlint.js b/src/bootlint.js
index 6bf7c14..d58b5da 100644
--- a/src/bootlint.js
+++ b/src/bootlint.js
@@ -1049,6 +1049,15 @@ var LocationIndex = _location.LocationIndex;
reporter('Button classes (`.btn`, `.btn-*`, `.navbar-btn`) cannot be used on `<a>`s within `.navbar-nav`s.', navbarNavAnchorBtns);
}
});
+ addLinter("E044", function lintInputGroupAddonChildren($, reporter) {
+ var badInputGroups = $('.input-group').filter(function () {
+ var inputGroup = $(this);
+ return !inputGroup.children('.form-control').length || !inputGroup.children('.input-group-addon, .input-group-btn').length;
+ });
+ if (badInputGroups.length) {
+ reporter('`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`.', badInputGroups);
+ }
+ });
addLinter("E045", function lintImgResponsiveOnNonImgs($, reporter) {
var imgResponsiveNotOnImg = $('.img-responsive:not(img)');
if (imgResponsiveNotOnImg.length) {