]> source.dussan.org Git - jquery.git/commitdiff
Build: align eslint config with 3.x branch as much as possible
authorTimmy Willison <timmywil@users.noreply.github.com>
Fri, 9 Aug 2024 01:39:11 +0000 (21:39 -0400)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2024 01:39:11 +0000 (21:39 -0400)
Close gh-5524

build/release/dist.js
eslint.config.js

index 5f1545b71c3f0777c6106f1fdeb664aef45ff00a..19892b8b7a427a9a2dfde890a4261ae0f7b56451 100644 (file)
@@ -24,6 +24,7 @@ const distRepoFolder = "tmp/release/dist";
 
 // Files to be included in the dist repo.
 // README.md and bower.json are generated.
+// package.json is a simplified version of the original.
 const files = [
        "dist",
        "dist-module",
index b377cd5f9786298166ee9791384f6a44f7e4049d..ceb943dbbea9e61d5ee3c4436faceed19a23bf1a 100644 (file)
@@ -10,7 +10,7 @@ export default [
                // See https://github.com/eslint/eslint/discussions/17412
                ignores: [
                        "external",
-                       "**/tmp",
+                       "tmp",
                        "test/data/json_obj.js",
                        "test/data/jquery-*.js"
                ]
@@ -67,6 +67,10 @@ export default [
                                }
                        ],
                        "no-implicit-globals": "error",
+                       "no-unused-vars": [
+                               "error",
+                               { caughtErrorsIgnorePattern: "^_" }
+                       ],
                        "one-var": [ "error", { var: "always" } ],
                        strict: [ "error", "function" ]
                }
@@ -298,6 +302,10 @@ export default [
                rules: {
                        ...jqueryConfig.rules,
                        "no-implicit-globals": "error",
+                       "no-unused-vars": [
+                               "error",
+                               { caughtErrorsIgnorePattern: "^_" }
+                       ],
                        strict: [ "error", "global" ]
                }
        },
@@ -332,6 +340,11 @@ export default [
                        // That is okay for the built version
                        "no-multiple-empty-lines": "off",
 
+                       "no-unused-vars": [
+                               "error",
+                               { caughtErrorsIgnorePattern: "^_" }
+                       ],
+
                        // When custom compilation is used, the version string
                        // can get large. Accept that in the built version.
                        "max-len": "off",