Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit af9235d

Browse files
committed
Switched from JSHint to ESLint
1 parent 84acfee commit af9235d

18 files changed

Lines changed: 193 additions & 231 deletions

.brackets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"defaultExtension": "js",
3+
"language": {
4+
"javascript": {
5+
"linting.prefer": ["ESLint"],
6+
"linting.usePreferredOnly": true
7+
}
8+
},
9+
"spaceUnits": 4,
10+
"useTabChar": false
11+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Third party modules
2+
**/thirdparty/**

.eslintrc.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"rules": {
6+
"no-bitwise": 2,
7+
"curly": 2,
8+
"eqeqeq": 2,
9+
"guard-for-in": 2,
10+
"wrap-iife": [2, "outside"],
11+
"no-use-before-define": 2,
12+
"new-cap": 2,
13+
"no-caller": 2,
14+
"no-empty": 2,
15+
"no-new": 2,
16+
"no-invalid-regexp": 2,
17+
"no-control-regex": 2,
18+
"no-regex-spaces": 2,
19+
"no-undef": 2,
20+
"strict": 2,
21+
"no-unused-vars": [2, {"vars": "all", "args": "none"}],
22+
"semi": 2,
23+
24+
"no-iterator": 2,
25+
"no-loop-func": 2,
26+
"no-multi-str": 2,
27+
"no-fallthrough": 2,
28+
"no-proto": 2,
29+
"no-script-url": 2,
30+
"no-shadow": 0,
31+
"no-shadow-restricted-names": 2,
32+
"no-new-func": 2,
33+
"no-new-wrappers": 2,
34+
"no-new-require": 2,
35+
"new-parens": 2,
36+
"no-new-object": 2,
37+
"no-invalid-this": 2,
38+
"indent": [2, 4],
39+
40+
"valid-jsdoc": 0,
41+
"valid-typeof": 2,
42+
43+
"no-trailing-spaces": [2, { "skipBlankLines": true }],
44+
"eol-last": 2
45+
}
46+
}

.jshintrc

Lines changed: 0 additions & 75 deletions
This file was deleted.

Gruntfile.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
* DEALINGS IN THE SOFTWARE.
2121
*
2222
*/
23-
/*jslint regexp:true*/
24-
/*global module, require, process*/
23+
2524
module.exports = function (grunt) {
2625
"use strict";
2726

2827
var common = require("./tasks/common")(grunt),
29-
resolve = common.resolve,
3028
platform = common.platform(),
3129
staging;
3230

@@ -202,10 +200,14 @@ module.exports = function (grunt) {
202200
"dest" : "deps/cef"
203201
}
204202
},
205-
"jshint": {
206-
"all" : ["Gruntfile.js", "tasks/**/*.js"],
203+
"eslint": {
204+
"all" : [
205+
"Gruntfile.js",
206+
"tasks/**/*.js",
207+
"appshell/node-core/*.js"
208+
],
207209
"options": {
208-
"jshintrc" : ".jshintrc"
210+
"quiet" : true
209211
}
210212
},
211213
"build": {
@@ -235,7 +237,7 @@ module.exports = function (grunt) {
235237
});
236238

237239
grunt.loadTasks("tasks");
238-
grunt.loadNpmTasks("grunt-contrib-jshint");
240+
grunt.loadNpmTasks("grunt-eslint");
239241
grunt.loadNpmTasks("grunt-contrib-copy");
240242
grunt.loadNpmTasks("grunt-contrib-clean");
241243
grunt.loadNpmTasks("grunt-curl");

appshell/appshell_extensions.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
// Note: All file native file i/o functions are synchronous, but are exposed
2828
// here as asynchronous calls.
2929

30-
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
31-
/*global define, native */
32-
3330
var appshell;
3431
if (!appshell) {
3532
appshell = {};

appshell/node-core/BaseDomain.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
/*
22
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
99
* Software is furnished to do so, subject to the following conditions:
10-
*
10+
*
1111
* The above copyright notice and this permission notice shall be included in
1212
* all copies or substantial portions of the Software.
13-
*
13+
*
1414
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020
* DEALINGS IN THE SOFTWARE.
21-
*
21+
*
2222
*/
2323

24-
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
25-
maxerr: 50, node: true */
26-
/*global */
27-
2824
(function () {
2925
"use strict";
3026

appshell/node-core/ConnectionManager.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
/*
22
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
99
* Software is furnished to do so, subject to the following conditions:
10-
*
10+
*
1111
* The above copyright notice and this permission notice shall be included in
1212
* all copies or substantial portions of the Software.
13-
*
13+
*
1414
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020
* DEALINGS IN THE SOFTWARE.
21-
*
21+
*
2222
*/
2323

24-
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
25-
maxerr: 50, node: true */
26-
/*global */
27-
2824
(function () {
2925
"use strict";
3026

@@ -69,7 +65,7 @@ maxerr: 50, node: true */
6965
/**
7066
* @private
7167
* Sends a message over the WebSocket. Called by public sendX commands.
72-
* @param {string} type Message type. Currently supported types are
68+
* @param {string} type Message type. Currently supported types are
7369
"event", "commandResponse", "commandError", "error"
7470
* @param {object} message Message body, must be JSON.stringify-able
7571
*/
@@ -132,7 +128,9 @@ maxerr: 50, node: true */
132128
if (this._ws) {
133129
try {
134130
this._ws.close();
135-
} catch (e) { }
131+
} catch (e) {
132+
// Do nothing
133+
}
136134
}
137135
this._connected = false;
138136
_connections.splice(_connections.indexOf(this), 1);
@@ -182,7 +180,7 @@ maxerr: 50, node: true */
182180
};
183181

184182
/**
185-
* Sends a response indicating that an error occurred during command
183+
* Sends a response indicating that an error occurred during command
186184
* execution
187185
* @param {number} id unique ID of the command that was executed. ID is
188186
* generated by the client when the command is issued.
@@ -226,7 +224,9 @@ maxerr: 50, node: true */
226224
for (i = 0; i < _connections.length; i++) {
227225
try {
228226
_connections[i].close();
229-
} catch (err) { }
227+
} catch (err) {
228+
// Do nothing
229+
}
230230
}
231231
_connections = [];
232232
}

appshell/node-core/DomainManager.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
/*
22
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
99
* Software is furnished to do so, subject to the following conditions:
10-
*
10+
*
1111
* The above copyright notice and this permission notice shall be included in
1212
* all copies or substantial portions of the Software.
13-
*
13+
*
1414
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020
* DEALINGS IN THE SOFTWARE.
21-
*
21+
*
2222
*/
2323

24-
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
25-
maxerr: 50, node: true */
26-
/*global */
27-
2824
(function () {
2925
"use strict";
3026

27+
// TODO: verify if this has any side effects, and if not remove it.
28+
require("./Server");
29+
3130
var util = require("util"),
32-
server = require("./Server"),
3331
ConnectionManager = require("./ConnectionManager");
3432

3533
/**

0 commit comments

Comments
 (0)