From c6b6772348e3c1bb7cb76c33d88e27fefa8156e9 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 16 Oct 2014 18:25:51 -0700 Subject: [PATCH] grunt dist --- dist/browser/bootlint.js | 150 +++++++++++++++++++++++---------------- 1 file changed, 87 insertions(+), 63 deletions(-) diff --git a/dist/browser/bootlint.js b/dist/browser/bootlint.js index 926ee5e..d3c6d64 100644 --- a/dist/browser/bootlint.js +++ b/dist/browser/bootlint.js @@ -10458,15 +10458,17 @@ var semver = require('semver'); return runs; } - function LintError(id, message) { + function LintError(id, message, elements) { this.id = id; this.message = message; + this.elements = elements || cheerio(''); } exports.LintError = LintError; - function LintWarning(id, message) { + function LintWarning(id, message, elements) { this.id = id; this.message = message; + this.elements = elements || cheerio(''); } exports.LintWarning = LintWarning; @@ -10488,8 +10490,8 @@ var semver = require('semver'); } function linterWrapper($, reporter) { - function specializedReporter(message) { - reporter(new Problem(id, message)); + function specializedReporter(message, elements) { + reporter(new Problem(id, message, elements)); } linter($, specializedReporter); @@ -10543,7 +10545,7 @@ var semver = require('semver'); reporter(' is missing UTF-8 charset tag'); } else if (charset.toLowerCase() !== "utf-8") { - reporter('charset tag is specifying a legacy, non-UTF-8 charset'); + reporter('charset tag is specifying a legacy, non-UTF-8 charset', meta); } }); addLinter("W002", function lintXUaCompatible($, reporter) { @@ -10566,7 +10568,7 @@ var semver = require('semver'); var selector = columnClasses.join(','); var spanNs = $(selector); if (spanNs.length) { - reporter("Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes"); + reporter("Found one or more uses of outdated Bootstrap v2 `.spanN` grid classes", spanNs); } }); addLinter("E003", function lintContainers($, reporter) { @@ -10586,13 +10588,13 @@ var semver = require('semver'); return true; }); if (rowsOutsideColumnsAndContainers.length) { - reporter("Found one or more `.row`s that were not children of a grid column or descendants of a `.container` or `.container-fluid`"); + reporter("Found one or more `.row`s that were not children of a grid column or descendants of a `.container` or `.container-fluid`", 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"); + reporter("Containers (`.container` and `.container-fluid`) are not nestable", nestedContainers); } }); addLinter("E005", function lintRowAndColOnSameElem($, reporter) { @@ -10602,13 +10604,13 @@ var semver = require('semver'); var rowCols = $(selector); if (rowCols.length) { - reporter("Found both `.row` and `.col-*-*` used on the same element"); + reporter("Found both `.row` and `.col-*-*` used on the same element", rowCols); } }); addLinter("W004", function lintRemoteModals($, reporter) { var remoteModalTriggers = $('[data-toggle="modal"][data-remote]'); if (remoteModalTriggers.length) { - reporter("Found one or more modals using the deprecated `remote` option"); + reporter("Found one or more modals using the deprecated `remote` option", remoteModalTriggers); } }); addLinter("W005", function lintJquery($, reporter) { @@ -10664,24 +10666,25 @@ var semver = require('semver'); return; } jqueries.each(function () { - var matches = $(this).attr('src').match(/\d+\.\d+\.\d+/g); + var script = $(this); + var matches = script.attr('src').match(/\d+\.\d+\.\d+/g); if (!matches) { return; } var version = matches[matches.length - 1]; if (!semver.gte(version, MIN_JQUERY_VERSION, true)) { - reporter(OLD_JQUERY); + reporter(OLD_JQUERY, script); } }); }); addLinter("E006", function lintInputGroupFormControlTypes($, reporter) { var selectInputGroups = $('.input-group select'); if (selectInputGroups.length) { - reporter("`.input-group` contains a s cannot be fully styled in WebKit browsers"); + reporter("`.input-group` contains a s cannot be fully styled in WebKit browsers", selectInputGroups); } var textareaInputGroups = $('.input-group textarea'); if (textareaInputGroups.length) { - reporter("`.input-group` contains a