mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Lint docs js too and use `strict consistently. (#24160)
This commit is contained in:
parent
fe06814f3e
commit
502ac7ee4d
9 changed files with 41 additions and 21 deletions
|
@ -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': {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = (ctx) => ({
|
||||
map: ctx.file.dirname.startsWith('docs') ? false : {
|
||||
inline: false,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const babel = require('rollup-plugin-babel')
|
||||
const resolve = require('rollup-plugin-node-resolve')
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const swBuild = require('workbox-build')
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
$(document).ready(function () {
|
||||
$(function () {
|
||||
'use strict'
|
||||
|
||||
$('[data-toggle="offcanvas"]').on('click', function () {
|
||||
$('.row-offcanvas').toggleClass('active')
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue