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

Commit cb55f1d

Browse files
committed
Remove various checks
* W002 (X-UA-Compatible) * W010 (.pull-left or .pull-right in .media) * W015 (Bootstrap 4) * E002 (Bootstrap v2 grid) * E030 (.glyphicon-* without .glyphicon) * E031 (.glyphicon on element with content or children) * E038 (.media-left/.media-right outside of .media)
1 parent 70a771c commit cb55f1d

21 files changed

+1
-745
lines changed

src/bootlint.js

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,6 @@ var LocationIndex = _location.LocationIndex;
338338
});
339339
*/
340340
/*
341-
addLinter('W002', function lintXUaCompatible($, reporter) {
342-
var meta = $([
343-
'head>meta[http-equiv="X-UA-Compatible"][content="IE=edge"]',
344-
'head>meta[http-equiv="x-ua-compatible"][content="ie=edge"]'
345-
].join(','));
346-
if (!meta.length) {
347-
reporter('`<head>` is missing X-UA-Compatible `<meta>` tag that disables old IE compatibility modes');
348-
}
349-
});
350-
*/
351-
/*
352341
addLinter('W003', function lintViewport($, reporter) {
353342
var meta = $('head>meta[name="viewport"][content]');
354343
if (!meta.length) {
@@ -496,14 +485,6 @@ var LocationIndex = _location.LocationIndex;
496485
});
497486
});
498487
/*
499-
addLinter('W010', function lintMediaPulls($, reporter) {
500-
var mediaPulls = $('.media>.pull-left, .media>.pull-right');
501-
if (mediaPulls.length) {
502-
reporter('Using `.pull-left` or `.pull-right` as part of the media object component is deprecated as of Bootstrap v3.3.0. Use `.media-left` or `.media-right` instead.');
503-
}
504-
});
505-
*/
506-
/*
507488
addLinter('W012', function lintNavbarContainers($, reporter) {
508489
var navBars = $('.navbar');
509490
var containers = [
@@ -564,36 +545,6 @@ var LocationIndex = _location.LocationIndex;
564545
});
565546
*/
566547
/*
567-
addLinter('W015', function lintNewBootstrap($, reporter) {
568-
var FUTURE_VERSION_ERROR = 'Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.';
569-
var theWindow = getBrowserWindowObject();
570-
571-
var globaljQuery = theWindow && (theWindow.$ || theWindow.jQuery);
572-
// @covignore
573-
if (globaljQuery) {
574-
var versions = jqueryPluginVersions(globaljQuery);
575-
if (versions.length) {
576-
var minVersion = versions[0];
577-
if (semver.gte(minVersion, BOOTSTRAP_VERSION_4, true)) {
578-
reporter(FUTURE_VERSION_ERROR);
579-
return;
580-
}
581-
}
582-
}
583-
// check for Bootstrap <link>s and <script>s
584-
var bootstraps = $(BOOTSTRAP_FILES);
585-
bootstraps.each(function () {
586-
var version = versionInLinkedElement($, this);
587-
if (version === null) {
588-
return;
589-
}
590-
if (semver.gte(version, BOOTSTRAP_VERSION_4, true)) {
591-
reporter(FUTURE_VERSION_ERROR, $(this));
592-
}
593-
});
594-
});
595-
*/
596-
/*
597548
addLinter('W016', function lintDisabledClassOnButton($, reporter) {
598549
var btnsWithDisabledClass = $('button.btn.disabled, input.btn.disabled');
599550
if (btnsWithDisabledClass.length) {
@@ -644,19 +595,6 @@ var LocationIndex = _location.LocationIndex;
644595
};
645596
})());
646597
/*
647-
addLinter('E002', function lintBootstrapv2($, reporter) {
648-
var columnClasses = [];
649-
for (var n = 1; n <= 12; n++) {
650-
columnClasses.push('.span' + n);
651-
}
652-
var selector = columnClasses.join(',');
653-
var spanNs = $(selector);
654-
if (spanNs.length) {
655-
reporter('Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes', spanNs);
656-
}
657-
});
658-
*/
659-
/*
660598
addLinter('E003', function lintContainers($, reporter) {
661599
var notAnyColClass = COL_CLASSES.map(function (colClass) {
662600
return ':not(' + colClass + ')';
@@ -975,24 +913,6 @@ var LocationIndex = _location.LocationIndex;
975913
});
976914
});
977915
/*
978-
addLinter('E030', function lintSoloGlyphiconClasses($, reporter) {
979-
var missingGlyphiconClass = $('[class*="glyphicon-"]:not(.glyphicon):not(.glyphicon-class)').filter(function () {
980-
return /\bglyphicon-([a-zA-Z]+)\b/.test($(this).attr('class'));
981-
});
982-
if (missingGlyphiconClass.length) {
983-
reporter('Found elements with a `.glyphicon-*` class that were missing the additional required `.glyphicon` class.', missingGlyphiconClass);
984-
}
985-
});
986-
*/
987-
/*
988-
addLinter('E031', function lintGlyphiconOnNonEmptyElement($, reporter) {
989-
var glyphiconNotEmpty = $('.glyphicon:not(:empty)');
990-
if (glyphiconNotEmpty.length) {
991-
reporter('Glyphicon classes must only be used on elements that contain no text content and have no child elements.', glyphiconNotEmpty);
992-
}
993-
});
994-
*/
995-
/*
996916
addLinter('E032', function lintModalStructure($, reporter) {
997917
var elements;
998918
@@ -1067,16 +987,6 @@ var LocationIndex = _location.LocationIndex;
1067987
}
1068988
});
1069989
/*
1070-
addLinter('E038', function lintMediaPulls($, reporter) {
1071-
var mediaPullsOutsideMedia = $('.media-left, .media-right').filter(function () {
1072-
return !$(this).parent().closest('.media').length;
1073-
});
1074-
if (mediaPullsOutsideMedia.length) {
1075-
reporter('`.media-left` and `.media-right` should not be used outside of `.media` objects.', mediaPullsOutsideMedia);
1076-
}
1077-
});
1078-
*/
1079-
/*
1080990
addLinter('E039', function lintNavbarPulls($, reporter) {
1081991
var navbarPullsOutsideNavbars = $('.navbar-left, .navbar-right').filter(function () {
1082992
return !$(this).parent().closest('.navbar').length;

test/_old_fixtures/bs-v2.html

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

test/_old_fixtures/glyphicons/missing-glyphicon-class.html

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

test/_old_fixtures/glyphicons/on-elem-with-child.html

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

test/_old_fixtures/glyphicons/on-elem-with-text.html

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

test/_old_fixtures/glyphicons/valid.html

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

test/_old_fixtures/media/deprecated-pull-classes.html

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

test/_old_fixtures/media/media-classes.html

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

test/_old_fixtures/media/media-pull-on-media.html

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

0 commit comments

Comments
 (0)