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

Commit

Permalink
Container-related checks
Browse files Browse the repository at this point in the history
Port E003 (misplaced .row), and remove E004
(nestable containers).
  • Loading branch information
Herst committed Jul 28, 2019
1 parent f7d2f09 commit 79ca109
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 149 deletions.
10 changes: 0 additions & 10 deletions src/bootlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ var LocationIndex = _location.LocationIndex;
}
};
})());
/*
addLinter('E003', function lintContainers($, reporter) {
var notAnyColClass = COL_CLASSES.map(function (colClass) {
return ':not(' + colClass + ')';
Expand All @@ -607,15 +606,6 @@ var LocationIndex = _location.LocationIndex;
reporter('Found one or more `.row`s that were not children of a grid column or descendants of a `.container` or `.container-fluid` or `.modal-body`', rowsOutsideColumnsAndContainers);
}
});
*/
/*
addLinter('E004', function lintNestedContainers($, reporter) {
var nestedContainers = $('.container, .container-fluid').children('.container, .container-fluid');
if (nestedContainers.length) {
reporter('Containers (`.container` and `.container-fluid`) are not nestable', nestedContainers);
}
});
*/
addLinter('E005', function lintRowAndColOnSameElem($, reporter) {
var selector = COL_CLASSES.map(function (col) {
return '.row' + col;
Expand Down
29 changes: 0 additions & 29 deletions test/_old_fixtures/containers/nested-fixed-fixed.html

This file was deleted.

29 changes: 0 additions & 29 deletions test/_old_fixtures/containers/nested-fixed-fluid.html

This file was deleted.

29 changes: 0 additions & 29 deletions test/_old_fixtures/containers/nested-fluid-fixed.html

This file was deleted.

29 changes: 0 additions & 29 deletions test/_old_fixtures/containers/nested-fluid-fluid.html

This file was deleted.

20 changes: 0 additions & 20 deletions test/bootlint_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,6 @@ exports.bootlint = {
'should not complain when rows are children of `.modal-body`.');
test.done();
},
*/
/*
'nested containers': function (test) {
test.expect(4);
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fixed-fixed.html')),
['Containers (`.container` and `.container-fluid`) are not nestable'],
'should complain when a container is within a container.');
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fixed-fluid.html')),
['Containers (`.container` and `.container-fluid`) are not nestable'],
'should complain when a container is within a container.');
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fluid-fluid.html')),
['Containers (`.container` and `.container-fluid`) are not nestable'],
'should complain when a container is within a container.');
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fluid-fixed.html')),
['Containers (`.container` and `.container-fluid`) are not nestable'],
'should complain when a container is within a container.');
test.done();
},
*/
/*
'viewport meta tag': function (test) {
test.expect(2);
Expand All @@ -138,7 +119,6 @@ exports.bootlint = {
'should complain when .row and .col* are used on the same element.');
test.done();
},
/*
'row and container classes on same element': function (test) {
test.expect(2);
test.deepEqual(lintHtml(utf8Fixture('containers/fixed-row-same-elem.html')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6">
<div class="col-sm-6">
<div class="row">
<div class="col-xs-12">
<div class="col-xl-12">
We can nest rows within columns.
</div>
</div>
</div>
<div class="col-xs-6">Rest</div>
<div class="col-md-6">Rest</div>
</div>
</div>

Expand Down

0 comments on commit 79ca109

Please sign in to comment.