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
diff options
context:
space:
mode:
authorHerst <Herst@users.noreply.github.com>2018-09-17 18:56:02 +0300
committerHerst <Herst@users.noreply.github.com>2019-08-19 10:17:12 +0300
commit2eee681e8179aa558968132692cf4f4d2c6ad5bc (patch)
treefff742ece53bf87977d0fdc95b900ce54245e57c
parentc499d3ad6cb86f147c754e1e70e9f48d33245c7f (diff)
Adapt for input group changesnext-input-group
E006, E010, E015 removed E009, E011, E012 ported
-rw-r--r--src/bootlint.js56
-rw-r--r--test/_old_fixtures/input-group/multiple-add-on-left.html31
-rw-r--r--test/_old_fixtures/input-group/multiple-add-on-right.html31
-rw-r--r--test/_old_fixtures/input-group/multiple-btn-add-on-left.html35
-rw-r--r--test/_old_fixtures/input-group/multiple-btn-add-on-right.html35
-rw-r--r--test/_old_fixtures/input-group/multiple-form-controls.html31
-rw-r--r--test/_old_fixtures/input-group/multiple-mixed-add-on-left.html33
-rw-r--r--test/_old_fixtures/input-group/select.html30
-rw-r--r--test/_old_fixtures/input-group/textarea.html30
-rw-r--r--test/_old_fixtures/input-group/valid.html28
-rw-r--r--test/bootlint_test.js65
-rw-r--r--test/fixtures/input-group/missing-form-control.html (renamed from test/_old_fixtures/input-group/missing-form-control.html)2
-rw-r--r--test/fixtures/input-group/missing-input-group-addon.html (renamed from test/_old_fixtures/input-group/missing-input-group-addon.html)4
-rw-r--r--test/fixtures/input-group/missing-input-group-sizing.html (renamed from test/_old_fixtures/input-group/missing-input-group-sizing.html)20
-rw-r--r--test/fixtures/input-group/mixed-with-form-group.html (renamed from test/_old_fixtures/input-group/mixed-with-form-group.html)4
-rw-r--r--test/fixtures/input-group/mixed-with-grid-col.html (renamed from test/_old_fixtures/input-group/mixed-with-grid-col.html)4
16 files changed, 29 insertions, 410 deletions
diff --git a/src/bootlint.js b/src/bootlint.js
index 6c0279a..13990d3 100644
--- a/src/bootlint.js
+++ b/src/bootlint.js
@@ -613,18 +613,6 @@ var LocationIndex = _location.LocationIndex;
}
});
/*
- addLinter('E006', function lintInputGroupFormControlTypes($, reporter) {
- var selectInputGroups = $('.input-group select');
- if (selectInputGroups.length) {
- reporter('`.input-group` contains a `<select>`; this should be avoided as `<select>`s cannot be fully styled in WebKit browsers', selectInputGroups);
- }
- var textareaInputGroups = $('.input-group textarea');
- if (textareaInputGroups.length) {
- reporter('`.input-group` contains a `<textarea>`; only text-based `<input>`s are permitted in an `.input-group`', textareaInputGroups);
- }
- });
- */
- /*
addLinter('E007', function lintBootstrapJs($, reporter) {
var scripts = bootstrapScriptsIn($);
if (scripts.longhands.length && scripts.minifieds.length) {
@@ -632,38 +620,24 @@ var LocationIndex = _location.LocationIndex;
}
});
*/
- /*
addLinter('E009', function lintMissingInputGroupSizes($, reporter) {
var selector = [
'.input-group:not(.input-group-lg) .btn-lg',
- '.input-group:not(.input-group-lg) .input-lg',
+ '.input-group:not(.input-group-lg) .form-control-lg',
'.input-group:not(.input-group-sm) .btn-sm',
- '.input-group:not(.input-group-sm) .input-sm'
+ '.input-group:not(.input-group-sm) .form-control-sm'
].join(',');
var badInputGroupSizing = $(selector);
if (badInputGroupSizing.length) {
reporter('Button and input sizing within `.input-group`s can cause issues. Instead, use input group sizing classes `.input-group-lg` or `.input-group-sm`', badInputGroupSizing);
}
});
- */
- /*
- addLinter('E010', function lintMultipleFormControlsInInputGroup($, reporter) {
- var badInputGroups = $('.input-group').filter(function (i, inputGroup) {
- return $(inputGroup).find('.form-control').length > 1;
- });
- if (badInputGroups.length) {
- reporter('Input groups cannot contain multiple `.form-control`s', badInputGroups);
- }
- });
- */
- /*
addLinter('E011', function lintFormGroupMixedWithInputGroup($, reporter) {
- var badMixes = $('.input-group.form-group');
+ var badMixes = $('.input-group.form-group, .input-group.row, .input-group.form-row');
if (badMixes.length) {
- reporter('`.input-group` and `.form-group` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`', badMixes);
+ reporter('`.input-group` and `.form-group`/`.row`/`.form-row` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`/`.row`/`.form-row`', badMixes);
}
});
- */
addLinter('E012', function lintGridClassMixedWithInputGroup($, reporter) {
var selector = COL_CLASSES.map(function (colClass) {
return '.input-group' + colClass;
@@ -697,22 +671,6 @@ var LocationIndex = _location.LocationIndex;
}
});
/*
- addLinter('E015', function lintInputGroupsWithMultipleAddOnsPerSide($, reporter) {
- var addOnClasses = ['.input-group-addon', '.input-group-btn'];
- var combos = [];
- addOnClasses.forEach(function (first) {
- addOnClasses.forEach(function (second) {
- combos.push('.input-group>' + first + '+' + second);
- });
- });
- var selector = combos.join(',');
- var multipleAddOns = $(selector);
- if (multipleAddOns.length) {
- reporter('Having multiple add-ons on a single side of an input group is not supported', multipleAddOns);
- }
- });
- */
- /*
addLinter('E016', function lintBtnToggle($, reporter) {
var badBtnToggle = $('.btn.dropdown-toggle ~ .btn');
if (badBtnToggle.length) {
@@ -1029,17 +987,15 @@ var LocationIndex = _location.LocationIndex;
}
});
*/
- /*
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;
+ return !inputGroup.children('.form-control, .custom-select, .custom-file').length || !inputGroup.children('.input-group-prepend, .input-group-append').length;
});
if (badInputGroups.length) {
- reporter('`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`.', badInputGroups);
+ reporter('`.input-group` must have at least one `.form-control`/`.custom-select`/`.custom-file` child and also at least one `.input-group-prepend`/`.input-group-append` child.', badInputGroups);
}
});
- */
addLinter('E045', function lintImgResponsiveOnNonImgs($, reporter) {
var imgResponsiveNotOnImg = $('.img-fluid:not(img)');
if (imgResponsiveNotOnImg.length) {
diff --git a/test/_old_fixtures/input-group/multiple-add-on-left.html b/test/_old_fixtures/input-group/multiple-add-on-left.html
deleted file mode 100644
index 1a5eb9c..0000000
--- a/test/_old_fixtures/input-group/multiple-add-on-left.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <span class="input-group-addon">@</span>
- <input type="text" class="form-control" placeholder="Username">
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Having multiple add-ons on a single side of an input group is not supported"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/multiple-add-on-right.html b/test/_old_fixtures/input-group/multiple-add-on-right.html
deleted file mode 100644
index 7f9608b..0000000
--- a/test/_old_fixtures/input-group/multiple-add-on-right.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <input type="text" class="form-control" placeholder="Username">
- <span class="input-group-addon">.com</span>
- <span class="input-group-addon">.info</span>
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Having multiple add-ons on a single side of an input group is not supported"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/multiple-btn-add-on-left.html b/test/_old_fixtures/input-group/multiple-btn-add-on-left.html
deleted file mode 100644
index ce404e8..0000000
--- a/test/_old_fixtures/input-group/multiple-btn-add-on-left.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">Work it!</button>
- </span>
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">Harder!</button>
- </span>
- <input type="text" class="form-control">
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Having multiple add-ons on a single side of an input group is not supported"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/multiple-btn-add-on-right.html b/test/_old_fixtures/input-group/multiple-btn-add-on-right.html
deleted file mode 100644
index 00a7776..0000000
--- a/test/_old_fixtures/input-group/multiple-btn-add-on-right.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <input type="text" class="form-control">
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">Work it!</button>
- </span>
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">Harder!</button>
- </span>
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Having multiple add-ons on a single side of an input group is not supported"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/multiple-form-controls.html b/test/_old_fixtures/input-group/multiple-form-controls.html
deleted file mode 100644
index e4c96e3..0000000
--- a/test/_old_fixtures/input-group/multiple-form-controls.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <input type="text" class="form-control" placeholder="Username">
- <input type="text" class="form-control" placeholder="Username">
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Input groups cannot contain multiple `.form-control`s"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/multiple-mixed-add-on-left.html b/test/_old_fixtures/input-group/multiple-mixed-add-on-left.html
deleted file mode 100644
index e276812..0000000
--- a/test/_old_fixtures/input-group/multiple-mixed-add-on-left.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">Work it!</button>
- </span>
- <input type="text" class="form-control" placeholder="Username">
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="Having multiple add-ons on a single side of an input group is not supported"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/select.html b/test/_old_fixtures/input-group/select.html
deleted file mode 100644
index 710383f..0000000
--- a/test/_old_fixtures/input-group/select.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <select class="form-control"><option value="no-way">No-how</option></select>
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="`.input-group` contains a `&lt;select&gt;`; this should be avoided as `&lt;select&gt;`s cannot be fully styled in WebKit browsers"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/textarea.html b/test/_old_fixtures/input-group/textarea.html
deleted file mode 100644
index f57e410..0000000
--- a/test/_old_fixtures/input-group/textarea.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <textarea class="form-control">Abomination</textarea>
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint">
- <li data-lint="`.input-group` contains a `&lt;textarea&gt;`; only text-based `&lt;input&gt;`s are permitted in an `.input-group`"></li>
- </ol>
- </body>
-</html>
diff --git a/test/_old_fixtures/input-group/valid.html b/test/_old_fixtures/input-group/valid.html
deleted file mode 100644
index a9489fd..0000000
--- a/test/_old_fixtures/input-group/valid.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!doctype html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Test</title>
- <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css">
-
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
- <script src="../../../node_modules/qunit/qunit/qunit.js"></script>
- <script src="../../../dist/browser/bootlint.js"></script>
- <script src="../generic-qunit.js"></script>
- </head>
- <body>
- <div class="input-group">
- <span class="input-group-addon">@</span>
- <input type="text" class="form-control" placeholder="Username">
- </div>
-
- <div id="qunit"></div>
- <ol id="bootlint"></ol>
- </body>
-</html>
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index c3c7e2a..3eb33b5 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -167,21 +167,6 @@ exports.bootlint = {
},
*/
/*
- 'input groups with impermissible kind of form control': function (test) {
- test.expect(3);
- test.deepEqual(lintHtml(utf8Fixture('input-group/textarea.html')),
- ['`.input-group` contains a `<textarea>`; only text-based `<input>`s are permitted in an `.input-group`'],
- 'should complain about input groups with a <textarea> form control');
- test.deepEqual(lintHtml(utf8Fixture('input-group/select.html')),
- ['`.input-group` contains a `<select>`; this should be avoided as `<select>`s cannot be fully styled in WebKit browsers'],
- 'should complain about input groups with a <select> form control');
- test.deepEqual(lintHtml(utf8Fixture('input-group/valid.html')),
- [],
- 'should not complain about input groups with text-based <input>s.');
- test.done();
- },
- */
- /*
'tooltips and popovers on disabled elements': function (test) {
test.expect(1);
test.deepEqual(lintHtml(utf8Fixture('tooltips/on-disabled-elems.html')),
@@ -204,7 +189,6 @@ exports.bootlint = {
test.done();
},
*/
- /*
'btn/input sizing used without input-group-* size': function (test) {
test.expect(1);
test.deepEqual(lintHtml(utf8Fixture('input-group/missing-input-group-sizing.html')),
@@ -212,46 +196,30 @@ exports.bootlint = {
'should complain when an input/btn sizes are used within input-group.');
test.done();
},
- */
- /*
- 'input groups with multiple form controls': function (test) {
- test.expect(1);
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-form-controls.html')),
- ['Input groups cannot contain multiple `.form-control`s'],
- 'should complain when an input group contains multiple form controls.');
- test.done();
- },
- */
- /*
'mixing input groups with form groups': function (test) {
test.expect(1);
test.deepEqual(lintHtml(utf8Fixture('input-group/mixed-with-form-group.html')),
- ['`.input-group` and `.form-group` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`'],
- 'should complain when .input-group and .form-group are used on the same element.');
+ ['`.input-group` and `.form-group`/`.row`/`.form-row` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`/`.row`/`.form-row`'],
+ 'should complain when .input-group and .form-group/.row/.form-row are used on the same element.');
test.done();
},
- */
- /*
'mixing input groups with grid columns': function (test) {
test.expect(1);
test.deepEqual(lintHtml(utf8Fixture('input-group/mixed-with-grid-col.html')),
- ['`.input-group` and `.col-*-*` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.col-*-*`'],
+ ['`.input-group` and `.col*` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.col*`'],
'should complain when an input group has a grid column class on it.');
test.done();
},
- */
- /*
'input groups missing controls and addons': function (test) {
test.expect(2);
test.deepEqual(lintHtml(utf8Fixture('input-group/missing-input-group-addon.html')),
- ['`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`.'],
+ ['`.input-group` must have at least one `.form-control`/`.custom-select`/`.custom-file` child and also at least one `.input-group-prepend`/`.input-group-append` child.'],
'should complain when missing missing a `.form-control`');
test.deepEqual(lintHtml(utf8Fixture('input-group/missing-form-control.html')),
- ['`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`.'],
- 'should complain when missing missing a `.input-group-addon`');
+ ['`.input-group` must have at least one `.form-control`/`.custom-select`/`.custom-file` child and also at least one `.input-group-prepend`/`.input-group-append` child.'],
+ 'should complain when missing missing a `.input-group-prepend`');
test.done();
},
- */
'non-column children of rows': function (test) {
test.expect(2);
test.deepEqual(lintHtml(utf8Fixture('grid/non-col-row-children.html')),
@@ -263,27 +231,6 @@ exports.bootlint = {
test.done();
},
/*
- 'multiple columns on the same side of an input group': function (test) {
- test.expect(5);
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-add-on-left.html')),
- ['Having multiple add-ons on a single side of an input group is not supported'],
- 'should complain when multiple normal add-ons are on the left side of an input group.');
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-add-on-right.html')),
- ['Having multiple add-ons on a single side of an input group is not supported'],
- 'should complain when multiple normal add-ons are on the right side of an input group.');
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-btn-add-on-left.html')),
- ['Having multiple add-ons on a single side of an input group is not supported'],
- 'should complain when multiple button add-ons are on the left side of an input group.');
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-btn-add-on-right.html')),
- ['Having multiple add-ons on a single side of an input group is not supported'],
- 'should complain when multiple button add-ons are on the right side of an input group.');
- test.deepEqual(lintHtml(utf8Fixture('input-group/multiple-mixed-add-on-left.html')),
- ['Having multiple add-ons on a single side of an input group is not supported'],
- 'should complain when both a normal add-on and a button add-on are on the left side of an input group.');
- test.done();
- },
- */
- /*
'dropdown-toggle comes before btn': function (test) {
test.expect(2);
test.deepEqual(lintHtml(utf8Fixture('buttons/btn-toggle.html')),
diff --git a/test/_old_fixtures/input-group/missing-form-control.html b/test/fixtures/input-group/missing-form-control.html
index 5a10af8..317e2e8 100644
--- a/test/_old_fixtures/input-group/missing-form-control.html
+++ b/test/fixtures/input-group/missing-form-control.html
@@ -24,7 +24,7 @@
<div id="qunit"></div>
<ol id="bootlint">
- <li data-lint="`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`."></li>
+ <li data-lint="`.input-group` must have at least one `.form-control`/`.custom-select`/`.custom-file` child and also at least one `.input-group-prepend`/`.input-group-append` child."></li>
</ol>
</body>
</html>
diff --git a/test/_old_fixtures/input-group/missing-input-group-addon.html b/test/fixtures/input-group/missing-input-group-addon.html
index d90edd2..ed1c7e1 100644
--- a/test/_old_fixtures/input-group/missing-input-group-addon.html
+++ b/test/fixtures/input-group/missing-input-group-addon.html
@@ -19,12 +19,12 @@
<body>
<div class="input-group">
- <span class="input-group-addon">@</span>
+ <span class="input-group-prepend">@</span>
</div>
<div id="qunit"></div>
<ol id="bootlint">
- <li data-lint="`.input-group` must have a `.form-control` and either an `.input-group-addon` or an `.input-group-btn`."></li>
+ <li data-lint="`.input-group` must have at least one `.form-control`/`.custom-select`/`.custom-file` child and also at least one `.input-group-prepend`/`.input-group-append` child."></li>
</ol>
</body>
</html>
diff --git a/test/_old_fixtures/input-group/missing-input-group-sizing.html b/test/fixtures/input-group/missing-input-group-sizing.html
index 478fb3e..756b5e8 100644
--- a/test/_old_fixtures/input-group/missing-input-group-sizing.html
+++ b/test/fixtures/input-group/missing-input-group-sizing.html
@@ -19,18 +19,18 @@
<body>
<div class="input-group">
- <span class="input-group-btn">
- <button id="button1" class="btn btn-default btn-lg" type="button">Go!</button>
- </span>
- <input id="input1" type="text" class="form-control input-lg">
+ <div class="input-group-prepend">
+ <button id="button1" class="btn btn-default btn-sm" type="button">Go!</button>
+ </div>
+ <input id="input1" type="text" class="form-control form-control-sm">
</div>
- <div class="input-group">
- <span class="input-group-btn">
- <button id="button2" class="btn btn-default btn-lg" type="button">Go!</button>
- </span>
- <input id="input2" type="text" class="form-control input-lg">
- </div>
+ <!-- <div class="input-group"></div>
+ <input id="input2" type="text" class="form-control form-control-lg">
+ <div class="input-group-append">
+ <button id="button2" class="btn btn-default btn-lg" type="button">Go!</button>
+ </div>
+ </div> -->
<div id="qunit"></div>
<ol id="bootlint">
diff --git a/test/_old_fixtures/input-group/mixed-with-form-group.html b/test/fixtures/input-group/mixed-with-form-group.html
index 74d4d18..b9d41cf 100644
--- a/test/_old_fixtures/input-group/mixed-with-form-group.html
+++ b/test/fixtures/input-group/mixed-with-form-group.html
@@ -18,13 +18,13 @@
</head>
<body>
<div class="input-group form-group">
- <span class="input-group-addon">@</span>
+ <span class="input-group-prepend">@</span>
<input type="text" class="form-control" placeholder="Username">
</div>
<div id="qunit"></div>
<ol id="bootlint">
- <li data-lint="`.input-group` and `.form-group` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`"></li>
+ <li data-lint="`.input-group` and `.form-group`/`.row`/`.form-row` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.form-group`/`.row`/`.form-row`"></li>
</ol>
</body>
</html>
diff --git a/test/_old_fixtures/input-group/mixed-with-grid-col.html b/test/fixtures/input-group/mixed-with-grid-col.html
index 805bdd5..f09b479 100644
--- a/test/_old_fixtures/input-group/mixed-with-grid-col.html
+++ b/test/fixtures/input-group/mixed-with-grid-col.html
@@ -20,7 +20,7 @@
<div class="container">
<div class="row">
<div class="input-group col-sm-12">
- <span class="input-group-addon">@</span>
+ <span class="input-group-prepend">@</span>
<input type="text" class="form-control" placeholder="Username">
</div>
</div>
@@ -28,7 +28,7 @@
<div id="qunit"></div>
<ol id="bootlint">
- <li data-lint="`.input-group` and `.col-*-*` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.col-*-*`"></li>
+ <li data-lint="`.input-group` and `.col*` cannot be used directly on the same element. Instead, nest the `.input-group` within the `.col*`"></li>
</ol>
</body>
</html>