From: XhmikosR Date: Thu, 28 Sep 2017 14:25:28 +0000 (+0300) Subject: Lint docs js too and use `strict consistently. (#24160) X-Git-Tag: v4.0.0-beta.2~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=502ac7ee4d13669e644b9181f1e014ce0ea1f089;p=thirdparty%2Fbootstrap.git Lint docs js too and use `strict consistently. (#24160) --- diff --git a/Gruntfile.js b/Gruntfile.js index 351802b94f..28f25b48c6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,9 +6,9 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -module.exports = function (grunt) { - 'use strict' +'use strict' +module.exports = function (grunt) { // Project configuration. grunt.initConfig({ 'saucelabs-qunit': { diff --git a/build/postcss.config.js b/build/postcss.config.js index 721e467c6e..b34a0ce467 100644 --- a/build/postcss.config.js +++ b/build/postcss.config.js @@ -1,3 +1,5 @@ +'use strict' + module.exports = (ctx) => ({ map: ctx.file.dirname.startsWith('docs') ? false : { inline: false, diff --git a/build/rollup.config.js b/build/rollup.config.js index 0f1a023e8e..9faeb08826 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,3 +1,5 @@ +'use strict' + const path = require('path') const babel = require('rollup-plugin-babel') const resolve = require('rollup-plugin-node-resolve') diff --git a/build/workbox.js b/build/workbox.js index 9d2bec27e4..bae5b35ccb 100644 --- a/build/workbox.js +++ b/build/workbox.js @@ -1,3 +1,5 @@ +'use strict' + const fs = require('fs') const path = require('path') const swBuild = require('workbox-build') diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 76d14dde99..ed4d95b70a 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied {% endexample %} diff --git a/docs/4.0/examples/offcanvas/offcanvas.js b/docs/4.0/examples/offcanvas/offcanvas.js index a89262a26a..a41847081b 100644 --- a/docs/4.0/examples/offcanvas/offcanvas.js +++ b/docs/4.0/examples/offcanvas/offcanvas.js @@ -1,5 +1,7 @@ -$(document).ready(function () { +$(function () { + 'use strict' + $('[data-toggle="offcanvas"]').on('click', function () { $('.row-offcanvas').toggleClass('active') - }); -}); + }) +}) diff --git a/docs/4.0/examples/tooltip-viewport/tooltip-viewport.js b/docs/4.0/examples/tooltip-viewport/tooltip-viewport.js index e87f4eec7f..dc75e18c63 100644 --- a/docs/4.0/examples/tooltip-viewport/tooltip-viewport.js +++ b/docs/4.0/examples/tooltip-viewport/tooltip-viewport.js @@ -1,18 +1,32 @@ -$(document).ready(function () { +$(function () { + 'use strict' + $('.tooltip-right').tooltip({ placement: 'right', - viewport: {selector: 'body', padding: 2} + viewport: { + selector: 'body', + padding: 2 + } }) $('.tooltip-bottom').tooltip({ placement: 'bottom', - viewport: {selector: 'body', padding: 2} + viewport: { + selector: 'body', + padding: 2 + } }) $('.tooltip-viewport-right').tooltip({ placement: 'right', - viewport: {selector: '.container-viewport', padding: 2} + viewport: { + selector: '.container-viewport', + padding: 2 + } }) $('.tooltip-viewport-bottom').tooltip({ placement: 'bottom', - viewport: {selector: '.container-viewport', padding: 2} + viewport: { + selector: '.container-viewport', + padding: 2 + } }) }) diff --git a/js/tests/.eslintrc.json b/js/tests/.eslintrc.json index b039801444..460286508b 100644 --- a/js/tests/.eslintrc.json +++ b/js/tests/.eslintrc.json @@ -21,9 +21,6 @@ "no-magic-numbers": "off", "vars-on-top": "off", - // Strict Mode - "strict": "off", - // NodeJS and CommonJS "global-require": "off", "no-process-env": "off", diff --git a/package.json b/package.json index 601dd09f76..85a641b34e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "js": "npm-run-all js-lint* js-compile js-minify", "js-docs": "npm-run-all js-lint-docs js-minify-docs", "js-lint": "eslint js/ && eslint --config js/tests/.eslintrc.json --env node build/ Gruntfile.js", - "js-lint-docs": "eslint --config js/tests/.eslintrc.json assets/js/ sw.js", + "js-lint-docs": "eslint --config js/tests/.eslintrc.json assets/js/ docs/ sw.js", "js-compile": "npm-run-all --parallel js-compile-*", "js-compile-standalone": "cross-env ROLLUP=true rollup --environment BUNDLE:false --config build/rollup.config.js", "js-compile-bundle": "cross-env ROLLUP=true rollup --environment BUNDLE:true --config build/rollup.config.js",