mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Lint docs js too and use `strict consistently. (#24160)
This commit is contained in:
parent
fe06814f3e
commit
502ac7ee4d
@ -6,9 +6,9 @@
|
|||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* 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.
|
// Project configuration.
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
'saucelabs-qunit': {
|
'saucelabs-qunit': {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
module.exports = (ctx) => ({
|
module.exports = (ctx) => ({
|
||||||
map: ctx.file.dirname.startsWith('docs') ? false : {
|
map: ctx.file.dirname.startsWith('docs') ? false : {
|
||||||
inline: false,
|
inline: false,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const babel = require('rollup-plugin-babel')
|
const babel = require('rollup-plugin-babel')
|
||||||
const resolve = require('rollup-plugin-node-resolve')
|
const resolve = require('rollup-plugin-node-resolve')
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const swBuild = require('workbox-build')
|
const swBuild = require('workbox-build')
|
||||||
|
@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied
|
|||||||
<script>
|
<script>
|
||||||
// Example starter JavaScript for disabling form submissions if there are invalid fields
|
// Example starter JavaScript for disabling form submissions if there are invalid fields
|
||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
'use strict';
|
||||||
window.addEventListener("load", function() {
|
|
||||||
var form = document.getElementById("needs-validation");
|
window.addEventListener('load', function() {
|
||||||
form.addEventListener("submit", function(event) {
|
var form = document.getElementById('needs-validation');
|
||||||
if (form.checkValidity() == false) {
|
form.addEventListener('submit', function(event) {
|
||||||
|
if (form.checkValidity() === false) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
form.classList.add("was-validated");
|
form.classList.add('was-validated');
|
||||||
}, false);
|
}, false);
|
||||||
}, false);
|
}, false);
|
||||||
}());
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
$(document).ready(function () {
|
$(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
$('[data-toggle="offcanvas"]').on('click', function () {
|
$('[data-toggle="offcanvas"]').on('click', function () {
|
||||||
$('.row-offcanvas').toggleClass('active')
|
$('.row-offcanvas').toggleClass('active')
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
$(document).ready(function () {
|
$(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
$('.tooltip-right').tooltip({
|
$('.tooltip-right').tooltip({
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
viewport: {selector: 'body', padding: 2}
|
viewport: {
|
||||||
|
selector: 'body',
|
||||||
|
padding: 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
$('.tooltip-bottom').tooltip({
|
$('.tooltip-bottom').tooltip({
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
viewport: {selector: 'body', padding: 2}
|
viewport: {
|
||||||
|
selector: 'body',
|
||||||
|
padding: 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
$('.tooltip-viewport-right').tooltip({
|
$('.tooltip-viewport-right').tooltip({
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
viewport: {selector: '.container-viewport', padding: 2}
|
viewport: {
|
||||||
|
selector: '.container-viewport',
|
||||||
|
padding: 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
$('.tooltip-viewport-bottom').tooltip({
|
$('.tooltip-viewport-bottom').tooltip({
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
viewport: {selector: '.container-viewport', padding: 2}
|
viewport: {
|
||||||
|
selector: '.container-viewport',
|
||||||
|
padding: 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -21,9 +21,6 @@
|
|||||||
"no-magic-numbers": "off",
|
"no-magic-numbers": "off",
|
||||||
"vars-on-top": "off",
|
"vars-on-top": "off",
|
||||||
|
|
||||||
// Strict Mode
|
|
||||||
"strict": "off",
|
|
||||||
|
|
||||||
// NodeJS and CommonJS
|
// NodeJS and CommonJS
|
||||||
"global-require": "off",
|
"global-require": "off",
|
||||||
"no-process-env": "off",
|
"no-process-env": "off",
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"js": "npm-run-all js-lint* js-compile js-minify",
|
"js": "npm-run-all js-lint* js-compile js-minify",
|
||||||
"js-docs": "npm-run-all js-lint-docs js-minify-docs",
|
"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": "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": "npm-run-all --parallel js-compile-*",
|
||||||
"js-compile-standalone": "cross-env ROLLUP=true rollup --environment BUNDLE:false --config build/rollup.config.js",
|
"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",
|
"js-compile-bundle": "cross-env ROLLUP=true rollup --environment BUNDLE:true --config build/rollup.config.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user