diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-09-22 17:20:29 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-11-09 16:46:48 +0300 |
commit | a6ed860040315b635463b3dfb1abcaa35dfa5570 (patch) | |
tree | d92261fa8fb26406917b658f4aa3888205d4478d | |
parent | 05bf1553f721a510672eb2ed6c74f392bb31b03e (diff) |
ESLint: enable --report-unused-disable-directives
-rw-r--r-- | app.js | 3 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/bootlint.js | 19 |
3 files changed, 8 insertions, 16 deletions
@@ -53,10 +53,7 @@ function lintsFor(html, disabledIds) { return lints; } - -/* eslint-disable new-cap */ var routes = express.Router(); -/* eslint-enable new-cap */ routes.get('/', function (req, res) { res.status(200).json({ diff --git a/package.json b/package.json index fdd6399..adfd59e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build": "npm run browserify && npm run minify", "dist": "npm run build", "coveralls": "nyc report --reporter=text-lcov | coveralls", - "eslint": "eslint --cache-location .cache/.eslintcache .", + "eslint": "eslint --cache-location .cache/.eslintcache --report-unused-disable-directives .", "lint": "npm run eslint", "minify": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"includeSources,url=bootlint.min.js.map\" --output dist/browser/bootlint.min.js dist/browser/bootlint.js", "nodeunit": "nodeunit test", diff --git a/src/bootlint.js b/src/bootlint.js index e1965b5..d495df7 100644 --- a/src/bootlint.js +++ b/src/bootlint.js @@ -193,9 +193,8 @@ var LocationIndex = _location.LocationIndex; function getBrowserWindowObject() { var theWindow = null; try { - /* eslint-disable no-undef, block-scoped-var */ + /* eslint-disable-next-line no-undef */ theWindow = window; - /* eslint-enable no-undef, block-scoped-var */ } catch (e) { // deliberately do nothing // empty @@ -364,13 +363,13 @@ var LocationIndex = _location.LocationIndex; var hasBsJs = Boolean(bsScripts.minifieds.length || bsScripts.longhands.length); var theWindow = null; try { - /* eslint-disable no-undef, block-scoped-var */ + /* eslint-disable-next-line no-undef */ theWindow = window; - /* eslint-enable no-undef, block-scoped-var */ } catch (e) { // deliberately do nothing // empty } + /* istanbul ignore if */ if (theWindow) { // check browser global jQuery @@ -610,9 +609,8 @@ var LocationIndex = _location.LocationIndex; /* istanbul ignore next */ return function lintDoctype($, reporter) { - /* eslint-disable no-undef, block-scoped-var */ + /* eslint-disable-next-line no-undef */ var doc = window.document; - /* eslint-enable un-undef, block-scoped-var */ if (doc.doctype === null) { reporter(MISSING_DOCTYPE); } else if (doc.doctype.publicId) { @@ -1217,9 +1215,8 @@ var LocationIndex = _location.LocationIndex; var background = 'background: #' + (lint.id[0] === 'W' ? 'f0ad4e' : 'd9534f') + '; color: #ffffff;'; if (!seenLint) { if (alertOnFirstProblem) { - /* eslint-disable no-alert, no-undef, block-scoped-var */ + /* eslint-disable-next-line no-alert, no-undef */ window.alert('bootlint found errors in this document! See the JavaScript console for details.'); - /* eslint-enable no-alert, no-undef, block-scoped-var */ } seenLint = true; } @@ -1236,14 +1233,12 @@ var LocationIndex = _location.LocationIndex; if (errorCount > 0) { console.info('bootlint: For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki'); } else if (alertIfNoProblems) { - /* eslint-disable no-alert, no-undef, block-scoped-var */ + /* eslint-disable-next-line no-alert, no-undef */ window.alert('bootlint found no errors in this document.'); - /* eslint-enable no-alert, no-undef, block-scoped-var */ } }; - /* eslint-disable no-undef, block-scoped-var */ + /* eslint-disable-next-line no-undef */ window.bootlint = exports; - /* eslint-enable no-undef, block-scoped-var */ })(); } })(typeof exports === 'object' && exports || this); |