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

Commit 8ccb578

Browse files
committed
Container-related checks
Port E003 (misplaced .row), and remove E004 (nestable containers).
1 parent 65d8daf commit 8ccb578

File tree

13 files changed

+3
-150
lines changed

13 files changed

+3
-150
lines changed

src/bootlint.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ var LocationIndex = _location.LocationIndex;
656656
}
657657
});
658658
*/
659-
/*
660659
addLinter('E003', function lintContainers($, reporter) {
661660
var notAnyColClass = COL_CLASSES.map(function (colClass) {
662661
return ':not(' + colClass + ')';
@@ -677,15 +676,6 @@ var LocationIndex = _location.LocationIndex;
677676
reporter('Found one or more `.row`s that were not children of a grid column or descendants of a `.container` or `.container-fluid`', rowsOutsideColumnsAndContainers);
678677
}
679678
});
680-
*/
681-
/*
682-
addLinter('E004', function lintNestedContainers($, reporter) {
683-
var nestedContainers = $('.container, .container-fluid').children('.container, .container-fluid');
684-
if (nestedContainers.length) {
685-
reporter('Containers (`.container` and `.container-fluid`) are not nestable', nestedContainers);
686-
}
687-
});
688-
*/
689679
addLinter('E005', function lintRowAndColOnSameElem($, reporter) {
690680
var selector = COL_CLASSES.map(function (col) {
691681
return '.row' + col;

test/_old_fixtures/containers/nested-fixed-fixed.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/_old_fixtures/containers/nested-fixed-fluid.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/_old_fixtures/containers/nested-fluid-fixed.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/_old_fixtures/containers/nested-fluid-fluid.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/bootlint_test.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ exports.bootlint = {
110110
test.done();
111111
},
112112
*/
113-
/*
114113
'rows outside containers': function (test) {
115114
test.expect(5);
116115
test.deepEqual(lintHtml(utf8Fixture('containers/fixed.html')),
@@ -130,25 +129,6 @@ exports.bootlint = {
130129
'should not complain when rows are descendants (but not children) of containers.');
131130
test.done();
132131
},
133-
*/
134-
/*
135-
'nested containers': function (test) {
136-
test.expect(4);
137-
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fixed-fixed.html')),
138-
['Containers (`.container` and `.container-fluid`) are not nestable'],
139-
'should complain when a container is within a container.');
140-
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fixed-fluid.html')),
141-
['Containers (`.container` and `.container-fluid`) are not nestable'],
142-
'should complain when a container is within a container.');
143-
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fluid-fluid.html')),
144-
['Containers (`.container` and `.container-fluid`) are not nestable'],
145-
'should complain when a container is within a container.');
146-
test.deepEqual(lintHtml(utf8Fixture('containers/nested-fluid-fixed.html')),
147-
['Containers (`.container` and `.container-fluid`) are not nestable'],
148-
'should complain when a container is within a container.');
149-
test.done();
150-
},
151-
*/
152132
/*
153133
'viewport meta tag': function (test) {
154134
test.expect(2);
@@ -171,7 +151,6 @@ exports.bootlint = {
171151
'should complain when .row and .col* are used on the same element.');
172152
test.done();
173153
},
174-
/*
175154
'row and container classes on same element': function (test) {
176155
test.expect(2);
177156
test.deepEqual(lintHtml(utf8Fixture('containers/fixed-row-same-elem.html')),

test/_old_fixtures/containers/columns.html renamed to test/fixtures/containers/columns.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
<body>
2020
<div class="container-fluid">
2121
<div class="row">
22-
<div class="col-xs-6">
22+
<div class="col-sm-6">
2323
<div class="row">
24-
<div class="col-xs-12">
24+
<div class="col-xl-12">
2525
We can nest rows within columns.
2626
</div>
2727
</div>
2828
</div>
29-
<div class="col-xs-6">Rest</div>
29+
<div class="col-md-6">Rest</div>
3030
</div>
3131
</div>
3232

File renamed without changes.

0 commit comments

Comments
 (0)