Build: Require strict mode in Node.js scripts via ESLint

So far, only browser-based JS files were required to be in strict mode (in the
function form). This commit adds such a requirement to Node.js scripts where
the global form is preferred. All Node.js scripts in sloppy mode were
converted to strict mode.

Closes gh-4499
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-10-09 00:17:55 +02:00 committed by GitHub
parent 4504fc3d72
commit bbad821c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 14 deletions

View File

@ -10,5 +10,9 @@
"env": {
"es6": true,
"node": true
},
"rules": {
"strict": ["error", "global"]
}
}

View File

@ -1,6 +1,6 @@
module.exports = function( grunt ) {
"use strict";
"use strict";
module.exports = function( grunt ) {
function readOptionalJSON( filepath ) {
var stripJSONComments = require( "strip-json-comments" ),
data = {};

View File

@ -1,3 +1,5 @@
"use strict";
var fs = require( "fs" );
module.exports = function( Release ) {

View File

@ -1,3 +1,5 @@
"use strict";
var
fs = require( "fs" ),
shell = require( "shelljs" ),

View File

@ -1,3 +1,5 @@
"use strict";
module.exports = function( Release, files, complete ) {
var

View File

@ -4,10 +4,9 @@
* and includes/excludes specified modules
*/
"use strict";
module.exports = function( grunt ) {
"use strict";
var fs = require( "fs" ),
requirejs = require( "requirejs" ),
Insight = require( "insight" ),

View File

@ -1,7 +1,6 @@
"use strict";
module.exports = function( grunt ) {
"use strict";
var fs = require( "fs" ),
filename = grunt.option( "filename" ),
distpaths = [

View File

@ -1,7 +1,6 @@
"use strict";
module.exports = ( grunt ) => {
"use strict";
const fs = require( "fs" );
const spawnTest = require( "./lib/spawn_test.js" );
const testsDir = "./test/node_smoke_tests/";

View File

@ -1,3 +1,5 @@
"use strict";
var fs = require( "fs" );
module.exports = function( grunt ) {

View File

@ -1,3 +1,5 @@
"use strict";
var fs = require( "fs" );
module.exports = function( grunt ) {

View File

@ -1,7 +1,6 @@
"use strict";
module.exports = function( grunt ) {
"use strict";
grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
timeout, testMode ) {
var jobName, config, tests,