]> source.dussan.org Git - jquery.git/commitdiff
Build: Lint the minified jQuery file as well
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 21 Jan 2020 12:51:03 +0000 (13:51 +0100)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 21 Jan 2020 13:06:42 +0000 (14:06 +0100)
While we have absolutely no style-related expectations to our minified file,
we do care that it's valid ES 5.1. This is now verified.

Also, update grunt-eslint as a newer ESLint version is required to be able
to use "extends" inside of the "overrides" section.

Fixes gh-3075
Closes gh-4594
Ref gh-4598

.eslintignore
Gruntfile.js
dist/.eslintrc.json
package.json

index 3ee82bba374d73bea30896a353df34fa369677e4..2d52f5cda93bc2ac1da0fe701583209a5d656aae 100644 (file)
@@ -3,6 +3,7 @@ node_modules
 *.min.js
 dist/**
 !dist/jquery.js
+!dist/jquery.min.js
 test/data/jquery-1.9.1.js
 test/data/badcall.js
 test/data/badjson.js
index b91fa1bed16fc354c13bc91866662a235709590b..af76ce3378412c5890acb15c11f171184e86a6e2 100644 (file)
@@ -107,7 +107,7 @@ module.exports = function( grunt ) {
                        // We have to explicitly declare "src" property otherwise "newer"
                        // task wouldn't work properly :/
                        dist: {
-                               src: "dist/jquery.js"
+                               src: [ "dist/jquery.js", "dist/jquery.min.js" ]
                        },
                        dev: {
                                src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]
index 45ba0c520461ed26ec96c89a19667b44eef1fcce..ff02f72bc7ab2a1bf59f7b9e55547350b8c84bd1 100644 (file)
@@ -1,23 +1,33 @@
 {
        "root": true,
 
-       "extends": "../.eslintrc-browser.json",
+       "parserOptions": {
+               "ecmaVersion": 5,
+               "sourceType": "script"
+       },
 
-       "rules": {
-               // That is okay for the built version
-               "no-multiple-empty-lines": "off",
+       "overrides": [
+               {
+                       "files": "jquery.js",
+                       "extends": "../.eslintrc-browser.json",
 
-               // Sizzle is not compatible with jQuery code style
-               "no-nested-ternary": "off",
-               "no-unused-expressions": "off",
-               "no-unused-vars": "off",
-               "lines-around-comment": "off",
-               "space-in-parens": "off",
-               "camelcase": "off",
-               "computed-property-spacing": "off",
-               "max-len": "off",
-               "dot-notation": "off",
-               "semi-spacing": "off",
-               "brace-style": "off"
-       }
+                       "rules": {
+                               // That is okay for the built version
+                               "no-multiple-empty-lines": "off",
+
+                               // Sizzle is not compatible with jQuery code style
+                               "no-nested-ternary": "off",
+                               "no-unused-expressions": "off",
+                               "no-unused-vars": "off",
+                               "lines-around-comment": "off",
+                               "space-in-parens": "off",
+                               "camelcase": "off",
+                               "computed-property-spacing": "off",
+                               "max-len": "off",
+                               "dot-notation": "off",
+                               "semi-spacing": "off",
+                               "brace-style": "off"
+                       }
+               }
+       ]
 }
index 2de617df7892a6b3bc99284fb901c344f880109a..905e6a15eb2549996ddad5076b2bbc930fbb4131 100644 (file)
@@ -36,7 +36,7 @@
     "grunt-compare-size": "0.4.2",
     "grunt-contrib-uglify": "3.4.0",
     "grunt-contrib-watch": "1.1.0",
-    "grunt-eslint": "21.0.0",
+    "grunt-eslint": "22.0.0",
     "grunt-git-authors": "3.2.0",
     "grunt-jsonlint": "1.1.0",
     "grunt-karma": "3.0.1",