Skip to content

Commit 37df5cd

Browse files
committed
Build: Lint the minified jQuery file as well
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
1 parent 46c284b commit 37df5cd

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
*.min.js
44
dist/**
55
!dist/jquery.js
6+
!dist/jquery.min.js
67
test/data/jquery-1.9.1.js
78
test/data/badcall.js
89
test/data/badjson.js

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = function( grunt ) {
107107
// We have to explicitly declare "src" property otherwise "newer"
108108
// task wouldn't work properly :/
109109
dist: {
110-
src: "dist/jquery.js"
110+
src: [ "dist/jquery.js", "dist/jquery.min.js" ]
111111
},
112112
dev: {
113113
src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]

dist/.eslintrc.json

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
{
22
"root": true,
33

4-
"extends": "../.eslintrc-browser.json",
4+
"parserOptions": {
5+
"ecmaVersion": 5,
6+
"sourceType": "script"
7+
},
58

6-
"rules": {
7-
// That is okay for the built version
8-
"no-multiple-empty-lines": "off",
9+
"overrides": [
10+
{
11+
"files": "jquery.js",
12+
"extends": "../.eslintrc-browser.json",
913

10-
// Sizzle is not compatible with jQuery code style
11-
"no-nested-ternary": "off",
12-
"no-unused-expressions": "off",
13-
"no-unused-vars": "off",
14-
"lines-around-comment": "off",
15-
"space-in-parens": "off",
16-
"camelcase": "off",
17-
"computed-property-spacing": "off",
18-
"max-len": "off",
19-
"dot-notation": "off",
20-
"semi-spacing": "off",
21-
"brace-style": "off"
22-
}
14+
"rules": {
15+
// That is okay for the built version
16+
"no-multiple-empty-lines": "off",
17+
18+
// Sizzle is not compatible with jQuery code style
19+
"no-nested-ternary": "off",
20+
"no-unused-expressions": "off",
21+
"no-unused-vars": "off",
22+
"lines-around-comment": "off",
23+
"space-in-parens": "off",
24+
"camelcase": "off",
25+
"computed-property-spacing": "off",
26+
"max-len": "off",
27+
"dot-notation": "off",
28+
"semi-spacing": "off",
29+
"brace-style": "off"
30+
}
31+
}
32+
]
2333
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"grunt-compare-size": "0.4.2",
3737
"grunt-contrib-uglify": "3.4.0",
3838
"grunt-contrib-watch": "1.1.0",
39-
"grunt-eslint": "21.0.0",
39+
"grunt-eslint": "22.0.0",
4040
"grunt-git-authors": "3.2.0",
4141
"grunt-jsonlint": "1.1.0",
4242
"grunt-karma": "3.0.1",

0 commit comments

Comments
 (0)