From 7639bc37122b063079cb5a4dfde9fbc9616ddf79 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 13 Mar 2019 18:04:12 +0200 Subject: [PATCH] Replace old coverage ignore directives with the istanbul ones. --- src/bootlint.js | 18 +++++++++--------- src/location.js | 8 +++++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/bootlint.js b/src/bootlint.js index 5194f767..e1965b5e 100644 --- a/src/bootlint.js +++ b/src/bootlint.js @@ -74,7 +74,7 @@ var LocationIndex = _location.LocationIndex; return element.name.toUpperCase(); } : function (element) { - /* @covignore */ + /* istanbul ignore next */ return element.tagName.toUpperCase(); }; @@ -226,7 +226,7 @@ var LocationIndex = _location.LocationIndex; } function jqueryPluginVersions(jQuery) { - /* @covignore */ + /* istanbul ignore next */ return PLUGINS.map(function (pluginName) { var plugin = jQuery.fn[pluginName]; if (!plugin) { @@ -291,7 +291,7 @@ var LocationIndex = _location.LocationIndex; var allLinters = {}; function addLinter(id, linter) { if (allLinters[id]) { - /* @covignore */ + /* istanbul ignore next */ throw new Error('Linter already registered with ID: ' + id); } @@ -301,7 +301,7 @@ var LocationIndex = _location.LocationIndex; } else if (id[0] === 'W') { Problem = LintWarning; } else { - /* @covignore */ + /* istanbul ignore next */ throw new Error('Invalid linter ID: ' + id); } @@ -371,7 +371,7 @@ var LocationIndex = _location.LocationIndex; // deliberately do nothing // empty } - /* @covignore */ + /* istanbul ignore if */ if (theWindow) { // check browser global jQuery var globaljQuery = theWindow.$ || theWindow.jQuery; @@ -512,7 +512,7 @@ var LocationIndex = _location.LocationIndex; var OUTDATED_BOOTSTRAP = 'Bootstrap version might be outdated. Latest version is at least ' + CURRENT_BOOTSTRAP_VERSION + ' ; saw what appears to be usage of Bootstrap '; var theWindow = getBrowserWindowObject(); var globaljQuery = theWindow && (theWindow.$ || theWindow.jQuery); - /* @covignore */ + /* istanbul ignore if */ if (globaljQuery) { var versions = jqueryPluginVersions(globaljQuery); if (versions.length) { @@ -552,7 +552,7 @@ var LocationIndex = _location.LocationIndex; var theWindow = getBrowserWindowObject(); var globaljQuery = theWindow && (theWindow.$ || theWindow.jQuery); - /* @covignore */ + /* istanbul ignore if */ if (globaljQuery) { var versions = jqueryPluginVersions(globaljQuery); if (versions.length) { @@ -608,7 +608,7 @@ var LocationIndex = _location.LocationIndex; }; } - /* @covignore */ + /* istanbul ignore next */ return function lintDoctype($, reporter) { /* eslint-disable no-undef, block-scoped-var */ var doc = window.document; @@ -1184,7 +1184,7 @@ var LocationIndex = _location.LocationIndex; }; } else { // jQuery; in-browser - /* @covignore */ + /* istanbul ignore next */ (function () { var $ = cheerio; /** diff --git a/src/location.js b/src/location.js index 64eef6af..1cd2753f 100644 --- a/src/location.js +++ b/src/location.js @@ -40,7 +40,7 @@ var binarySearch = require('binary-search'); while (charIndex < string.length) { charIndex = string.indexOf('\n', charIndex); if (charIndex === -1) { - /* @covignore */ + /* istanbul ignore next */ break; } charIndex++;// go past the newline @@ -72,8 +72,10 @@ var binarySearch = require('binary-search'); return 0; }); - if (index < 0) { // binarySearch returns a negative number (but not necessarily -1) when match not found - /* @covignore */ + + // binarySearch returns a negative number (but not necessarily -1) when match not found + if (index < 0) { + /* istanbul ignore next */ return null; } var lineStartEnd = this._lineStartEndTriples[index];