diff options
author | Herst <Herst@users.noreply.github.com> | 2018-12-27 00:52:28 +0300 |
---|---|---|
committer | Herst <Herst@users.noreply.github.com> | 2019-07-26 17:29:15 +0300 |
commit | da4f53c2fbebd110f864bd4eb34dac6d58dd58a8 (patch) | |
tree | b6903874f85b0cae43591a167b9302bafe66606d | |
parent | 0258293ef3418f1d52756d4c81e5131463907d6d (diff) |
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)
20 files changed, 0 insertions, 721 deletions
diff --git a/src/bootlint.js b/src/bootlint.js index e5e0f2c..2f69fb3 100644 --- a/src/bootlint.js +++ b/src/bootlint.js @@ -338,17 +338,6 @@ var LocationIndex = _location.LocationIndex; }); */ /* - addLinter('W002', function lintXUaCompatible($, reporter) { - var meta = $([ - 'head>meta[http-equiv="X-UA-Compatible"][content="IE=edge"]', - 'head>meta[http-equiv="x-ua-compatible"][content="ie=edge"]' - ].join(',')); - if (!meta.length) { - reporter('`<head>` is missing X-UA-Compatible `<meta>` tag that disables old IE compatibility modes'); - } - }); - */ - /* addLinter('W003', function lintViewport($, reporter) { var meta = $('head>meta[name="viewport"][content]'); if (!meta.length) { @@ -496,14 +485,6 @@ var LocationIndex = _location.LocationIndex; }); }); /* - addLinter('W010', function lintMediaPulls($, reporter) { - var mediaPulls = $('.media>.pull-left, .media>.pull-right'); - if (mediaPulls.length) { - 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.'); - } - }); - */ - /* addLinter('W012', function lintNavbarContainers($, reporter) { var navBars = $('.navbar'); var containers = [ @@ -564,36 +545,6 @@ var LocationIndex = _location.LocationIndex; }); */ /* - addLinter('W015', function lintNewBootstrap($, reporter) { - var FUTURE_VERSION_ERROR = 'Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.'; - var theWindow = getBrowserWindowObject(); - - var globaljQuery = theWindow && (theWindow.$ || theWindow.jQuery); - // istanbul ignore if - if (globaljQuery) { - var versions = jqueryPluginVersions(globaljQuery); - if (versions.length) { - var minVersion = versions[0]; - if (semver.gte(minVersion, BOOTSTRAP_VERSION_4, true)) { - reporter(FUTURE_VERSION_ERROR); - return; - } - } - } - // check for Bootstrap <link>s and <script>s - var bootstraps = $(BOOTSTRAP_FILES); - bootstraps.each(function () { - var version = versionInLinkedElement($, this); - if (version === null) { - return; - } - if (semver.gte(version, BOOTSTRAP_VERSION_4, true)) { - reporter(FUTURE_VERSION_ERROR, $(this)); - } - }); - }); - */ - /* addLinter('W016', function lintDisabledClassOnButton($, reporter) { var btnsWithDisabledClass = $('button.btn.disabled, input.btn.disabled'); if (btnsWithDisabledClass.length) { @@ -644,19 +595,6 @@ var LocationIndex = _location.LocationIndex; }; })()); /* - addLinter('E002', function lintBootstrapv2($, reporter) { - var columnClasses = []; - for (var n = 1; n <= 12; n++) { - columnClasses.push('.span' + n); - } - var selector = columnClasses.join(','); - var spanNs = $(selector); - if (spanNs.length) { - reporter('Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes', spanNs); - } - }); - */ - /* addLinter('E003', function lintContainers($, reporter) { var notAnyColClass = COL_CLASSES.map(function (colClass) { return ':not(' + colClass + ')'; @@ -975,24 +913,6 @@ var LocationIndex = _location.LocationIndex; }); }); /* - addLinter('E030', function lintSoloGlyphiconClasses($, reporter) { - var missingGlyphiconClass = $('[class*="glyphicon-"]:not(.glyphicon):not(.glyphicon-class)').filter(function () { - return /\bglyphicon-([a-zA-Z]+)\b/.test($(this).attr('class')); - }); - if (missingGlyphiconClass.length) { - reporter('Found elements with a `.glyphicon-*` class that were missing the additional required `.glyphicon` class.', missingGlyphiconClass); - } - }); - */ - /* - addLinter('E031', function lintGlyphiconOnNonEmptyElement($, reporter) { - var glyphiconNotEmpty = $('.glyphicon:not(:empty)'); - if (glyphiconNotEmpty.length) { - reporter('Glyphicon classes must only be used on elements that contain no text content and have no child elements.', glyphiconNotEmpty); - } - }); - */ - /* addLinter('E032', function lintModalStructure($, reporter) { var elements; @@ -1067,16 +987,6 @@ var LocationIndex = _location.LocationIndex; } }); /* - addLinter('E038', function lintMediaPulls($, reporter) { - var mediaPullsOutsideMedia = $('.media-left, .media-right').filter(function () { - return !$(this).parent().closest('.media').length; - }); - if (mediaPullsOutsideMedia.length) { - reporter('`.media-left` and `.media-right` should not be used outside of `.media` objects.', mediaPullsOutsideMedia); - } - }); - */ - /* addLinter('E039', function lintNavbarPulls($, reporter) { var navbarPullsOutsideNavbars = $('.navbar-left, .navbar-right').filter(function () { return !$(this).parent().closest('.navbar').length; diff --git a/test/_old_fixtures/bs-v2.html b/test/_old_fixtures/bs-v2.html deleted file mode 100644 index a7a5f8b..0000000 --- a/test/_old_fixtures/bs-v2.html +++ /dev/null @@ -1,32 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../dist/browser/bootlint.js"></script> - <script src="generic-qunit.js"></script> - </head> - <body> - <div class="container"> - <div class="row"> - <div class="span12"></div> - </div> - </div> - - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes"></li> - <li data-lint="Only columns (`.col-*-*`) may be children of `.row`s"></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/glyphicons/missing-glyphicon-class.html b/test/_old_fixtures/glyphicons/missing-glyphicon-class.html deleted file mode 100644 index 0f355bd..0000000 --- a/test/_old_fixtures/glyphicons/missing-glyphicon-class.html +++ /dev/null @@ -1,27 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <span class="glyphicon-asterisk"></span> - - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Found elements with a `.glyphicon-*` class that were missing the additional required `.glyphicon` class."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/glyphicons/on-elem-with-child.html b/test/_old_fixtures/glyphicons/on-elem-with-child.html deleted file mode 100644 index 5483bc5..0000000 --- a/test/_old_fixtures/glyphicons/on-elem-with-child.html +++ /dev/null @@ -1,27 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <span class="glyphicon glyphicon-asterisk"><span id="bad-child"></span></span> - - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Glyphicon classes must only be used on elements that contain no text content and have no child elements."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/glyphicons/on-elem-with-text.html b/test/_old_fixtures/glyphicons/on-elem-with-text.html deleted file mode 100644 index add8f8c..0000000 --- a/test/_old_fixtures/glyphicons/on-elem-with-text.html +++ /dev/null @@ -1,27 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <span class="glyphicon glyphicon-asterisk">This text is not allowed</span> - - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Glyphicon classes must only be used on elements that contain no text content and have no child elements."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/glyphicons/valid.html b/test/_old_fixtures/glyphicons/valid.html deleted file mode 100644 index 86c189c..0000000 --- a/test/_old_fixtures/glyphicons/valid.html +++ /dev/null @@ -1,25 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <span class="glyphicon glyphicon-asterisk"></span> - - <div id="qunit"></div> - <ol id="bootlint"></ol> - </body> -</html> diff --git a/test/_old_fixtures/media/deprecated-pull-classes.html b/test/_old_fixtures/media/deprecated-pull-classes.html deleted file mode 100644 index d1cacba..0000000 --- a/test/_old_fixtures/media/deprecated-pull-classes.html +++ /dev/null @@ -1,33 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div class="media"> - <a class="pull-right" href="#"> - <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGRlZnMvPjxyZWN0IHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjE0LjUiIHk9IjMyIiBzdHlsZT0iZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQ7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+NjR4NjQ8L3RleHQ+PC9nPjwvc3ZnPg==" alt=""> - </a> - <div class="media-body"> - <h4 class="media-heading">Media heading</h4> - </div> - </div> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="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."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/media/media-classes.html b/test/_old_fixtures/media/media-classes.html deleted file mode 100644 index 24b3176..0000000 --- a/test/_old_fixtures/media/media-classes.html +++ /dev/null @@ -1,39 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div class="media"> - <a class="media-left" href="#"> - <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGRlZnMvPjxyZWN0IHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjE0LjUiIHk9IjMyIiBzdHlsZT0iZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQ7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+NjR4NjQ8L3RleHQ+PC9nPjwvc3ZnPg==" alt=""> - </a> - <div class="media-body"> - <h4 class="media-heading">Media heading</h4> - </div> - </div> - <div class="media"> - <a class="media-right" href="#"> - <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGRlZnMvPjxyZWN0IHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjE0LjUiIHk9IjMyIiBzdHlsZT0iZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQ7ZG9taW5hbnQtYmFzZWxpbmU6Y2VudHJhbCI+NjR4NjQ8L3RleHQ+PC9nPjwvc3ZnPg==" alt=""> - </a> - <div class="media-body"> - <h4 class="media-heading">Media heading</h4> - </div> - </div> - <div id="qunit"></div> - <ol id="bootlint"></ol> - </body> -</html> diff --git a/test/_old_fixtures/media/media-pull-on-media.html b/test/_old_fixtures/media/media-pull-on-media.html deleted file mode 100644 index 2797d3d..0000000 --- a/test/_old_fixtures/media/media-pull-on-media.html +++ /dev/null @@ -1,35 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div class="media media-left"> - <div class="media-body"> - <h4 class="media-heading">Media heading</h4> - </div> - </div> - <div class="media media-right"> - <div class="media-body"> - <h4 class="media-heading">Media heading</h4> - </div> - </div> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="`.media-left` and `.media-right` should not be used outside of `.media` objects."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/media/misplaced-media-left.html b/test/_old_fixtures/media/misplaced-media-left.html deleted file mode 100644 index e6fd970..0000000 --- a/test/_old_fixtures/media/misplaced-media-left.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <a class="media-left" href="#">Where is my media object?</a> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="`.media-left` and `.media-right` should not be used outside of `.media` objects."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/media/misplaced-media-right.html b/test/_old_fixtures/media/misplaced-media-right.html deleted file mode 100644 index 1ed04ce..0000000 --- a/test/_old_fixtures/media/misplaced-media-right.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <a class="media-right" href="#">Where is my media object?</a> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="`.media-left` and `.media-right` should not be used outside of `.media` objects."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/bootstrap-css.html b/test/_old_fixtures/version-4/bootstrap-css.html deleted file mode 100644 index 1a9a959..0000000 --- a/test/_old_fixtures/version-4/bootstrap-css.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <link rel="stylesheet" href="css/4.0.0/bootstrap.css"> - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/bootstrap-extensions-okay.html b/test/_old_fixtures/version-4/bootstrap-extensions-okay.html deleted file mode 100644 index f428e0c..0000000 --- a/test/_old_fixtures/version-4/bootstrap-extensions-okay.html +++ /dev/null @@ -1,28 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.999.999/css/bootstrap.css"> - <link rel="stylesheet" href="other-library/4.0.0/plugin-for-bootstrap.css"> - <link rel="stylesheet" href="other-library/4.0.0/plugin-for-bootstrap.min.css"> - <script src="other-library/4.0.0/plugin-for-bootstrap.css"></script> - <script src="other-library/4.0.0/plugin-for-bootstrap.min.css"></script> - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"></ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/bootstrap-js.html b/test/_old_fixtures/version-4/bootstrap-js.html deleted file mode 100644 index ec220ba..0000000 --- a/test/_old_fixtures/version-4/bootstrap-js.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/bootstrap-min-css.html b/test/_old_fixtures/version-4/bootstrap-min-css.html deleted file mode 100644 index 3e7dd34..0000000 --- a/test/_old_fixtures/version-4/bootstrap-min-css.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/bootstrap-min-js.html b/test/_old_fixtures/version-4/bootstrap-min-js.html deleted file mode 100644 index 1f8790d..0000000 --- a/test/_old_fixtures/version-4/bootstrap-min-js.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/version-4/js-version-not-in-url-4.0.0.html b/test/_old_fixtures/version-4/js-version-not-in-url-4.0.0.html deleted file mode 100644 index 369d665..0000000 --- a/test/_old_fixtures/version-4/js-version-not-in-url-4.0.0.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script> - (function () { - window.$.fn.modal = { Constructor: { VERSION: '4.0.0' } }; - })(); - </script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3."></li> - </ol> - </body> -</html> diff --git a/test/_old_fixtures/x-ua-compatible/lowercase.html b/test/_old_fixtures/x-ua-compatible/lowercase.html deleted file mode 100644 index 26b1381..0000000 --- a/test/_old_fixtures/x-ua-compatible/lowercase.html +++ /dev/null @@ -1,23 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="x-ua-compatible" content="ie=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"></ol> - </body> -</html> diff --git a/test/_old_fixtures/x-ua-compatible/missing.html b/test/_old_fixtures/x-ua-compatible/missing.html deleted file mode 100644 index abe26b1..0000000 --- a/test/_old_fixtures/x-ua-compatible/missing.html +++ /dev/null @@ -1,24 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test</title> - <link rel="stylesheet" href="../../../node_modules/qunit/qunit/qunit.css"> - - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - <script src="../../../node_modules/jquery/dist/jquery.min.js"></script> - <script src="../../../node_modules/qunit/qunit/qunit.js"></script> - <script src="../../../dist/browser/bootlint.js"></script> - <script src="../generic-qunit.js"></script> - </head> - <body> - <div id="qunit"></div> - <ol id="bootlint"> - <li data-lint="`<head>` is missing X-UA-Compatible `<meta>` tag that disables old IE compatibility modes"></li> - </ol> - </body> -</html> diff --git a/test/bootlint_test.js b/test/bootlint_test.js index 760d8b3..f7afee5 100644 --- a/test/bootlint_test.js +++ b/test/bootlint_test.js @@ -57,15 +57,6 @@ exports.bootlint = { test.done(); }, /* - 'disabling lint checks': function (test) { - test.expect(1); - test.deepEqual(lintHtml(utf8Fixture('bs-v2.html'), ['E002', 'E013']), - [], - 'should complain when Bootstrap v2 grid classes are present.'); - test.done(); - }, - */ - /* 'UTF-8 charset meta tag': function (test) { test.expect(4); test.deepEqual(lintHtml(utf8Fixture('charset/utf8.html')), @@ -84,33 +75,6 @@ exports.bootlint = { }, */ /* - 'X-UA-Compatible': function (test) { - test.expect(3); - test.deepEqual(lintHtml(utf8Fixture('x-ua-compatible/present.html')), - [], - 'should not complain when X-UA-Compatible <meta> tag is present.'); - test.deepEqual(lintHtml(utf8Fixture('x-ua-compatible/lowercase.html')), - [], - 'should not complain when X-UA-Compatible <meta> tag is present but lowercased.'); - test.deepEqual(lintHtml(utf8Fixture('x-ua-compatible/missing.html')), - ['`<head>` is missing X-UA-Compatible `<meta>` tag that disables old IE compatibility modes'], - 'should complain when X-UA-Compatible <meta> tag is missing.'); - test.done(); - }, - */ - /* - 'Bootstrap v2': function (test) { - test.expect(1); - test.deepEqual(lintHtml(utf8Fixture('bs-v2.html')), - [ - 'Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes', - 'Only columns (`.col-*-*`) may be children of `.row`s' - ], - 'should complain when Bootstrap v2 grid classes are present.'); - test.done(); - }, - */ - /* 'rows outside containers': function (test) { test.expect(6); test.deepEqual(lintHtml(utf8Fixture('containers/fixed.html')), @@ -595,38 +559,6 @@ exports.bootlint = { }, */ /* - 'Glyphicons on non-empty elements': function (test) { - test.expect(3); - test.deepEqual(lintHtml(utf8Fixture('glyphicons/valid.html')), - [], - 'should not complain when the .glyphicon element has no text content or children.' - ); - test.deepEqual(lintHtml(utf8Fixture('glyphicons/on-elem-with-text.html')), - ['Glyphicon classes must only be used on elements that contain no text content and have no child elements.'], - 'should complain when Glyphicon is used on an element with text content.' - ); - test.deepEqual(lintHtml(utf8Fixture('glyphicons/on-elem-with-child.html')), - ['Glyphicon classes must only be used on elements that contain no text content and have no child elements.'], - 'should complain when Glyphicon is used on an element with child element(s).' - ); - test.done(); - }, - */ - /* - 'Glyphicons missing the .glyphicon class': function (test) { - test.expect(2); - test.deepEqual(lintHtml(utf8Fixture('glyphicons/valid.html')), - [], - 'should not complain when Glyphicon is used correctly.' - ); - test.deepEqual(lintHtml(utf8Fixture('glyphicons/missing-glyphicon-class.html')), - ['Found elements with a `.glyphicon-*` class that were missing the additional required `.glyphicon` class.'], - 'should complain when .glyphicon-* class is used without the .glyphicon class.' - ); - test.done(); - }, - */ - /* 'modal structure': function (test) { test.expect(7); test.deepEqual(lintHtml(utf8Fixture('modal/valid.html')), @@ -701,20 +633,6 @@ exports.bootlint = { }, */ /* - 'pull classes inside media': function (test) { - test.expect(2); - test.deepEqual(lintHtml(utf8Fixture('media/deprecated-pull-classes.html')), - ['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.'], - 'should complain about .pull-* classes in .media' - ); - test.deepEqual(lintHtml(utf8Fixture('media/media-classes.html')), - [], - 'should not complain about .media-left or .media-right classes.' - ); - test.done(); - }, - */ - 'invalid nonexistent .col*-0 classes': function (test) { test.expect(4); test.deepEqual(lintHtml(utf8Fixture('grid/col-sm-0.html')), @@ -769,27 +687,6 @@ exports.bootlint = { }, */ /* - 'version 4 of Bootstrap': function (test) { - test.expect(5); - test.deepEqual(lintHtml(utf8Fixture('version-4/bootstrap-css.html')), - ['Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.'], - 'should complain about version 4 of bootstrap.css.'); - test.deepEqual(lintHtml(utf8Fixture('version-4/bootstrap-min-css.html')), - ['Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.'], - 'should complain about version 4 of bootstrap.min.css.'); - test.deepEqual(lintHtml(utf8Fixture('version-4/bootstrap-js.html')), - ['Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.'], - 'should complain about version 4 of bootstrap.js.'); - test.deepEqual(lintHtml(utf8Fixture('version-4/bootstrap-min-js.html')), - ['Detected what appears to be Bootstrap v4 or later. This version of Bootlint only supports Bootstrap v3.'], - 'should complain about version 4 of bootstrap.min.js.'); - test.deepEqual(lintHtml(utf8Fixture('version-4/bootstrap-extensions-okay.html')), - [], - 'should not complain about v4.0.0+ libraries that just have "bootstrap" in their name.'); - test.done(); - }, - */ - /* 'carousel control target': function (test) { test.expect(3); test.deepEqual(lintHtml(utf8Fixture('carousel/indicators.html')), @@ -812,28 +709,6 @@ exports.bootlint = { }, */ /* - 'media pulls outside of media objects': function (test) { - test.expect(4); - test.deepEqual(lintHtml(utf8Fixture('media/media-classes.html')), - [], - 'should not complain about media pulls inside media objects.' - ); - test.deepEqual(lintHtml(utf8Fixture('media/misplaced-media-left.html')), - ['`.media-left` and `.media-right` should not be used outside of `.media` objects.'], - 'should complain about .media-left outside of a media object.' - ); - test.deepEqual(lintHtml(utf8Fixture('media/misplaced-media-right.html')), - ['`.media-left` and `.media-right` should not be used outside of `.media` objects.'], - 'should complain about .media-right outside of a media object.' - ); - test.deepEqual(lintHtml(utf8Fixture('media/media-pull-on-media.html')), - ['`.media-left` and `.media-right` should not be used outside of `.media` objects.'], - 'should complain about media pulls on .media itself.' - ); - test.done(); - }, - */ - /* 'navbar pulls outside of navbars': function (test) { test.expect(4); test.deepEqual(lintHtml(utf8Fixture('navbar/navbar-left-bad.html')), |