Skip to content

replaces jscs with eslint #1942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .jshintignore

This file was deleted.

16 changes: 0 additions & 16 deletions .jshintrc

This file was deleted.

40 changes: 5 additions & 35 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,25 +176,11 @@ grunt.initConfig( {
}
}
},

jscs: {
ui: {
options: {
config: true
},
files: {
src: [ "demos/**/*.js", "build/**/*.js", "ui/**/*.js" ]
}
eslint:{
options: {
configFile: "eslint.json"
},
tests: {
options: {
config: true,
maximumLineLength: null
},
files: {
src: [ "tests/**/*.js" ]
}
}
target:["demos/**/*.js", "build/**/*.js", "ui/**/*.js"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't follow the jQuery code style with regards to spacing; doesn't ESLint verify it?

},
uglify: minify,
htmllint: {
Expand Down Expand Up @@ -241,19 +227,6 @@ grunt.initConfig( {
}
}
},
jshint: {
options: {
jshintrc: true
},
all: [
"ui/*.js",
"Gruntfile.js",
"build/**/*.js",
"tests/unit/**/*.js",
"tests/lib/**/*.js",
"demos/**/*.js"
]
},
csslint: {
base_theme: {
src: "themes/base/*.css",
Expand Down Expand Up @@ -304,9 +277,6 @@ grunt.initConfig( {
"jquery-simulate/jquery.simulate.js": "jquery-simulate/jquery.simulate.js",
"jquery-simulate/LICENSE.txt": "jquery-simulate/LICENSE.txt",

"jshint/jshint.js": "jshint/dist/jshint.js",
"jshint/LICENSE": "jshint/LICENSE",

"jquery/jquery.js": "jquery-1.x/dist/jquery.js",
"jquery/LICENSE.txt": "jquery-1.x/LICENSE.txt",

Expand Down Expand Up @@ -508,7 +478,7 @@ grunt.registerTask( "update-authors", function() {

grunt.registerTask( "default", [ "lint", "requirejs", "test" ] );
grunt.registerTask( "jenkins", [ "default", "concat" ] );
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ] );
grunt.registerTask( "lint", [ "asciilint", "eslint", "csslint", "htmllint" ] );
grunt.registerTask( "test", [ "qunit" ] );
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ] );
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ] );
Expand Down
24 changes: 24 additions & 0 deletions eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "eslint:recommended",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jQuery projects are not supposed to use this preset but the jQuery one. This is to me a prerequisite to the migration, we can't migrate to a preset that doesn't verify rules jQuery cares about.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which preset would you recommend then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"env": {
"amd": true,
"browser": true
},
"globals": {
"jQuery": true,
"process": true,
"module": true,
"Buffer": true,
"Globalize": true
},
"rules": {
"no-constant-condition": 1,
"no-control-regex": 0,
"no-empty": 1,
"no-mixed-spaces-and-tabs": 1,
"no-redeclare": 0,
"no-shadow-restricted-names": 1,
"no-unexpected-multiline": 1,
"no-useless-escape": 1
}
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,26 @@
"jquery": ">=1.8.0 <4.0.0"
},
"devDependencies": {
"bufferutil": "^4.0.2",
"commitplease": "3.2.0",
"core-js": "^3.8.1",
"glob": "7.1.6",
"grunt": "1.3.0",
"grunt-bowercopy": "1.2.5",
"grunt-cli": "1.3.2",
"grunt-compare-size": "0.4.2",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-csslint": "2.0.0",
"grunt-contrib-jshint": "0.12.0",
"grunt-contrib-qunit": "4.0.0",
"grunt-contrib-requirejs": "1.0.0",
"grunt-contrib-uglify": "5.0.0",
"grunt-eslint": "^23.0.0",
"grunt-git-authors": "3.2.0",
"grunt-html": "14.2.0",
"grunt-jscs": "2.1.0",
"load-grunt-tasks": "5.1.0",
"minimatch": "^3.0.2",
"rimraf": "3.0.2",
"testswarm": "1.1.2"
"testswarm": "1.1.2",
"utf-8-validate": "^5.0.3"
},
"keywords": []
}