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>2019-08-18 19:09:34 +0300
committerHerst <Herst@users.noreply.github.com>2019-08-19 09:51:40 +0300
commitbc8b6998246d704d9c61d41926cdef782b921ace (patch)
treeecc8d22aa1a31658d02c8dca36ff24e88bbbaf49
parent828a0e96b6d624da868f1dff4bd40f23a9da5d3b (diff)
Adapt to responsive images change (#453)
Port E045
-rw-r--r--src/bootlint.js6
-rw-r--r--test/bootlint_test.js14
-rw-r--r--test/fixtures/images/img-fluid-bad.html (renamed from test/_old_fixtures/images/img-responsive-bad.html)4
-rw-r--r--test/fixtures/images/img-fluid-valid.html (renamed from test/_old_fixtures/images/img-responsive-valid.html)2
4 files changed, 11 insertions, 15 deletions
diff --git a/src/bootlint.js b/src/bootlint.js
index 80e6c8e..1cafead 100644
--- a/src/bootlint.js
+++ b/src/bootlint.js
@@ -1036,14 +1036,12 @@ var LocationIndex = _location.LocationIndex;
}
});
*/
- /*
addLinter('E045', function lintImgResponsiveOnNonImgs($, reporter) {
- var imgResponsiveNotOnImg = $('.img-responsive:not(img)');
+ var imgResponsiveNotOnImg = $('.img-fluid:not(img)');
if (imgResponsiveNotOnImg.length) {
- reporter('`.img-responsive` should only be used on `<img>`s', imgResponsiveNotOnImg);
+ reporter('`.img-fluid` should only be used on `<img>`s', imgResponsiveNotOnImg);
}
});
- */
addLinter('E046', function lintModalTabIndex($, reporter) {
var modalsWithoutTabindex = $('.modal:not([tabindex])');
if (modalsWithoutTabindex.length) {
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index 6d89ef7..80d2d0b 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -783,20 +783,18 @@ exports.bootlint = {
test.done();
},
*/
- /*
- '.img-responsive not on image': function (test) {
+ '.img-fluid not on image': function (test) {
test.expect(2);
- test.deepEqual(lintHtml(utf8Fixture('images/img-responsive-bad.html')),
- ['`.img-responsive` should only be used on `<img>`s'],
- 'should complain about .img-responsive not on an image.'
+ test.deepEqual(lintHtml(utf8Fixture('images/img-fluid-bad.html')),
+ ['`.img-fluid` should only be used on `<img>`s'],
+ 'should complain about .img-fluid not on an image.'
);
- test.deepEqual(lintHtml(utf8Fixture('images/img-responsive-valid.html')),
+ test.deepEqual(lintHtml(utf8Fixture('images/img-fluid-valid.html')),
[],
- 'should not complain about .img-responsive on an image.'
+ 'should not complain about .img-fluid on an image.'
);
test.done();
},
- */
/*
'btn classes on anchors within .navbar-nav': function (test) {
test.expect(2);
diff --git a/test/_old_fixtures/images/img-responsive-bad.html b/test/fixtures/images/img-fluid-bad.html
index a098964..491dfa7 100644
--- a/test/_old_fixtures/images/img-responsive-bad.html
+++ b/test/fixtures/images/img-fluid-bad.html
@@ -18,11 +18,11 @@
</head>
<body>
- <div class="img-responsive"></div>
+ <div class="img-fluid"></div>
<div id="qunit"></div>
<ol id="bootlint">
- <li data-lint="`.img-responsive` should only be used on `<img>`s"></li>
+ <li data-lint="`.img-fluid` should only be used on `<img>`s"></li>
</ol>
</body>
</html>
diff --git a/test/_old_fixtures/images/img-responsive-valid.html b/test/fixtures/images/img-fluid-valid.html
index 9590c1a..d87e588 100644
--- a/test/_old_fixtures/images/img-responsive-valid.html
+++ b/test/fixtures/images/img-fluid-valid.html
@@ -18,7 +18,7 @@
</head>
<body>
- <img class="img-responsive" alt="">
+ <img class="img-fluid" alt="">
<div id="qunit"></div>
<ol id="bootlint">