Skip to content

Commit a1665a4

Browse files
authored
Build: Update dependencies
Closes gh-458
1 parent 5ee8f69 commit a1665a4

File tree

5 files changed

+5960
-970
lines changed

5 files changed

+5960
-970
lines changed

.eslintrc-browser.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
"rules": {
2525
"one-var": [ "error", { "var": "always" } ],
26-
"strict": [ "error", "function" ]
26+
"strict": [ "error", "function" ],
27+
28+
// Support: IE <=9 only, Android <=4.0 only
29+
// Allow square bracket notation for ES3 reserved words
30+
"dot-notation": [ "error", { "allowKeywords": false } ]
2731
}
2832
}

Gruntfile.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module.exports = function( grunt ) {
66

77
const gzip = require( "gzip-js" );
88

9+
const oldNode = /^v10\./.test( process.version );
10+
911
const karmaFilesExceptJQuery = [
1012
"external/npo/npo.js",
1113
"dist/jquery-migrate.min.js",
@@ -31,6 +33,13 @@ module.exports = function( grunt ) {
3133
{ pattern: "test/**/*.@(js|json|css|jpg|html|xml)", included: false, served: true }
3234
];
3335

36+
// Support: Node.js <12
37+
// Skip running tasks that dropped support for Node.js 10
38+
// in this Node version.
39+
function runIfNewNode( task ) {
40+
return oldNode ? "print_old_node_message:" + task : task;
41+
}
42+
3443
// Project configuration.
3544
grunt.initConfig( {
3645
pkg: grunt.file.readJSON( "package.json" ),
@@ -141,17 +150,17 @@ module.exports = function( grunt ) {
141150
sourceMapName: "dist/jquery-migrate.min.map",
142151
report: "min",
143152
output: {
144-
"ascii_only": true,
153+
ascii_only: true,
145154

146155
// Support: Android 4.0 only
147156
// UglifyJS 3 breaks Android 4.0 if this option is not enabled.
148-
// This is in lieu of setting ie8 for all of mangle, compress, and output
149-
"ie8": true
157+
// This is in lieu of setting ie for all of mangle, compress, and output
158+
ie: true
150159
},
151160
banner: "/*! jQuery Migrate v<%= pkg.version %>" +
152161
" | (c) <%= pkg.author.name %> | jquery.org/license */",
153162
compress: {
154-
"hoist_funs": false,
163+
hoist_funs: false,
155164
loops: false,
156165

157166
// Support: IE <11
@@ -230,6 +239,11 @@ module.exports = function( grunt ) {
230239
// Integrate jQuery migrate specific tasks
231240
grunt.loadTasks( "build/tasks" );
232241

242+
grunt.registerTask( "print_old_node_message", ( ...args ) => {
243+
var task = args.join( ":" );
244+
grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
245+
} );
246+
233247
// Just an alias
234248
grunt.registerTask( "test", [
235249
"karma:main",
@@ -242,8 +256,8 @@ module.exports = function( grunt ) {
242256
// would run the dist target first which would point to errors in the built
243257
// file, making it harder to fix them. We want to check the built file only
244258
// if we already know the source files pass the linter.
245-
"eslint:dev",
246-
"eslint:dist"
259+
runIfNewNode( "eslint:dev" ),
260+
runIfNewNode( "eslint:dist" )
247261
] );
248262

249263
grunt.registerTask( "default-no-test", [

0 commit comments

Comments
 (0)