]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Lint docs js too and use `strict consistently. (#24160)
authorXhmikosR <xhmikosr@gmail.com>
Thu, 28 Sep 2017 14:25:28 +0000 (17:25 +0300)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2017 14:25:28 +0000 (17:25 +0300)
Gruntfile.js
build/postcss.config.js
build/rollup.config.js
build/workbox.js
docs/4.0/components/forms.md
docs/4.0/examples/offcanvas/offcanvas.js
docs/4.0/examples/tooltip-viewport/tooltip-viewport.js
js/tests/.eslintrc.json
package.json

index 351802b94f3597de875c11bd25bc1b3bfc2e6f82..28f25b48c62d649d9256349cab665c1d9cf49cb3 100644 (file)
@@ -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': {
index 721e467c6e384bb27676ec30375118adcf3d51ae..b34a0ce46741b76839132c02ea767c7113a3f8ba 100644 (file)
@@ -1,3 +1,5 @@
+'use strict'
+
 module.exports = (ctx) => ({
   map: ctx.file.dirname.startsWith('docs') ? false : {
     inline: false,
index 0f1a023e8eee15435ec246650ada507989af133c..9faeb08826bbd5ba0fee4d9351db5017e9fdc24a 100644 (file)
@@ -1,3 +1,5 @@
+'use strict'
+
 const path    = require('path')
 const babel   = require('rollup-plugin-babel')
 const resolve = require('rollup-plugin-node-resolve')
index 9d2bec27e46a80fdcba6c97c583425fbe0f5cb23..bae5b35ccb5f0d725cb0edc78c7cc63c0ba7a27f 100644 (file)
@@ -1,3 +1,5 @@
+'use strict'
+
 const fs = require('fs')
 const path = require('path')
 const swBuild = require('workbox-build')
index 76d14dde99c52153f9d55d9f6815bc5a1927d5b6..ed4d95b70a5b4a9cb22696a6045a9cc79532fc11 100644 (file)
@@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied
 <script>
 // Example starter JavaScript for disabling form submissions if there are invalid fields
 (function() {
-  "use strict";
-  window.addEventListener("load", function() {
-    var form = document.getElementById("needs-validation");
-    form.addEventListener("submit", function(event) {
-      if (form.checkValidity() == false) {
+  'use strict';
+
+  window.addEventListener('load', function() {
+    var form = document.getElementById('needs-validation');
+    form.addEventListener('submit', function(event) {
+      if (form.checkValidity() === false) {
         event.preventDefault();
         event.stopPropagation();
       }
-      form.classList.add("was-validated");
+      form.classList.add('was-validated');
     }, false);
   }, false);
-}());
+})();
 </script>
 {% endexample %}
 
index a89262a26aa42d16e7d9826e3b631ad34134ee69..a41847081bfbcc692fc19cadbbc09b9336d5943c 100644 (file)
@@ -1,5 +1,7 @@
-$(document).ready(function () {
+$(function () {
+  'use strict'
+
   $('[data-toggle="offcanvas"]').on('click', function () {
     $('.row-offcanvas').toggleClass('active')
-  });
-});
+  })
+})
index e87f4eec7f464bc60bb4f9d7a7911c2c75c1e924..dc75e18c63374b46ca647b571208d6625f1d44bf 100644 (file)
@@ -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
+    }
   })
 })
index b039801444fdd42eb9a6d5ad07c3392a6ec958c5..460286508bfde7fb932284e4d8fd4742ce111d1e 100644 (file)
@@ -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",
index 601dd09f767fd0fb4194ffa38e26affe5ed45ac3..85a641b34ea2d9837b0fc1d9d1d3ccf36c2d654c 100644 (file)
@@ -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",