Skip to content

Commit fc864c8

Browse files
authored
Build: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7
- Sinon is already at the latest version that supports IE9. - Upgraded uglify to 3.7.7, which is the latest that worked with IE9. I tried 3.9.4, which we are using in jquery-migrate, and 3.8.1, but there were failures in traversing ("Permission denied" errors). - Upgraded eslint to version 9, which required some changes. Mainly, unused arguments in catch expressions error by default in 9+. The config now makes use of `caughtErrorsIgnorePattern`, which is set to `"^_"`, the same as unused function params. - Ignored main branch dist files when switching branches. Closes jquerygh-5508
1 parent 8eb35e8 commit fc864c8

20 files changed

+503
-632
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ npm-debug.log*
1414

1515
/dist
1616

17+
# Ignore main branch builds
18+
/dist-module
19+
1720
/external
1821
/node_modules
1922

build/tasks/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function readdirRecursive( dir, all = [] ) {
5757
files = await fs.readdir( path.join( srcFolder, dir ), {
5858
withFileTypes: true
5959
} );
60-
} catch ( e ) {
60+
} catch ( _ ) {
6161
return all;
6262
}
6363
for ( const file of files ) {

build/tasks/compare_size.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function getCache( loc ) {
3636
try {
3737
const contents = await fs.readFile( loc, "utf8" );
3838
cache = JSON.parse( contents );
39-
} catch ( err ) {
39+
} catch ( _ ) {
4040
return {};
4141
}
4242

build/tasks/promises_aplus_tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function runTests() {
2424
spawn(
2525
command,
2626
[ test ].concat( args ),
27-
{ stdio: "inherit" }
27+
{ shell: true, stdio: "inherit" }
2828
);
2929
} );
3030
}

eslint.config.js

+27-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ module.exports = [
1111
// See https://github.com/eslint/eslint/discussions/17412
1212
ignores: [
1313
"external",
14-
"test/data/json_obj.js"
14+
"test/data/json_obj.js",
15+
"test/data/jquery-*.js",
16+
17+
// This avoids parsing local main branch builds
18+
"dist/jquery.factory.*",
19+
"dist-module"
1520
]
1621
},
1722

@@ -47,6 +52,10 @@ module.exports = [
4752
}
4853
],
4954
"no-implicit-globals": "error",
55+
"no-unused-vars": [
56+
"error",
57+
{ caughtErrorsIgnorePattern: "^_" }
58+
],
5059
"one-var": [ "error", { var: "always" } ],
5160
strict: [ "error", "function" ]
5261
}
@@ -105,7 +114,6 @@ module.exports = [
105114
"test/unit/**"
106115
],
107116
ignores: [
108-
"test/data/jquery-3.7.1.js",
109117
"test/data/badcall.js",
110118
"test/data/badjson.js",
111119
"test/data/support/csp.js",
@@ -149,7 +157,11 @@ module.exports = [
149157

150158
"no-unused-vars": [
151159
"error",
152-
{ args: "after-used", argsIgnorePattern: "^_" }
160+
{
161+
args: "after-used",
162+
argsIgnorePattern: "^_",
163+
caughtErrorsIgnorePattern: "^_"
164+
}
153165
],
154166

155167
// Too many errors
@@ -197,7 +209,9 @@ module.exports = [
197209
},
198210

199211
{
200-
files: [ "test/runner/listeners.js" ],
212+
files: [
213+
"test/runner/listeners.js"
214+
],
201215
languageOptions: {
202216
ecmaVersion: 5,
203217
sourceType: "script",
@@ -268,6 +282,10 @@ module.exports = [
268282
rules: {
269283
...jqueryConfig.rules,
270284
"no-implicit-globals": "error",
285+
"no-unused-vars": [
286+
"error",
287+
{ caughtErrorsIgnorePattern: "^_" }
288+
],
271289
strict: [ "error", "global" ]
272290
}
273291
},
@@ -302,6 +320,11 @@ module.exports = [
302320
// That is okay for the built version
303321
"no-multiple-empty-lines": "off",
304322

323+
"no-unused-vars": [
324+
"error",
325+
{ caughtErrorsIgnorePattern: "^_" }
326+
],
327+
305328
// When custom compilation is used, the version string
306329
// can get large. Accept that in the built version.
307330
"max-len": "off",

0 commit comments

Comments
 (0)