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

Commit

Permalink
Adapt to responsive images change (#453)
Browse files Browse the repository at this point in the history
Port E045
  • Loading branch information
Herst authored and XhmikosR committed Aug 18, 2019
1 parent 153baa4 commit 67f1ee6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/bootlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
14 changes: 6 additions & 8 deletions test/bootlint_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</head>
<body>

<img class="img-responsive" alt="">
<img class="img-fluid" alt="">

<div id="qunit"></div>
<ol id="bootlint">
Expand Down

0 comments on commit 67f1ee6

Please sign in to comment.