Skip to content

Build: Improve ESLint configuration, check all test files as well #339

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

Merged
merged 1 commit into from
Apr 19, 2020
Merged
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
30 changes: 30 additions & 0 deletions .eslintrc-browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,

"extends": "jquery",

// Support: IE <=9 only, Android <=4.0 only
// The above browsers are failing a lot of tests in the ES5
// test suite at http://test262.ecmascript.org.
"parserOptions": {
"ecmaVersion": 3
},

// The browser env is not enabled on purpose so that code takes
// all browser-only globals from window instead of assuming
// they're available as globals. This makes it possible to use
// jQuery with tools like jsdom which provide a custom window
// implementation.
"env": {},

"globals": {
"window": true,
"define": true,
"module": true
},

"rules": {
"one-var": ["error", {"var": "always"}],
"strict": ["error", "function"]
}
}
18 changes: 18 additions & 0 deletions .eslintrc-node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,

"extends": "jquery",

"parserOptions": {
"ecmaVersion": 2017
},

"env": {
"es6": true,
"node": true
},

"rules": {
"strict": ["error", "global"]
}
}
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "jquery",
"root": true,
"env": {
"browser": false,
"node": true
}

"extends": "./.eslintrc-node.json"
}
7 changes: 4 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*global module:false*/
module.exports = function( grunt ) {
"use strict";

/* global module:false */

"use strict";
module.exports = function( grunt ) {

var isTravis = process.env.TRAVIS;

Expand Down
2 changes: 2 additions & 0 deletions build/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* JQuery Migrate Plugin Release Management
*/

"use strict";

// Debugging variables
var dryrun = false,
skipRemote = false;
Expand Down
3 changes: 2 additions & 1 deletion dist/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"root": true,
"rules": {
// That is okay for the built version
"no-multiple-empty-lines": "off"
"no-multiple-empty-lines": "off",
"one-var": "off"
}
}
Loading