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

Commit

Permalink
Switched from JSHint to ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
ficristo committed Jan 8, 2016
1 parent 84acfee commit e9b562b
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 231 deletions.
11 changes: 11 additions & 0 deletions .brackets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"defaultExtension": "js",
"language": {
"javascript": {
"linting.prefer": ["ESLint"],
"linting.usePreferredOnly": true
}
},
"spaceUnits": 4,
"useTabChar": false
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Third party modules
**/thirdparty/**
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"env": {
"node": true
},
"rules": {
"no-bitwise": 2,
"curly": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"wrap-iife": [2, "outside"],
"no-use-before-define": 2,
"new-cap": 2,
"no-caller": 2,
"no-empty": 2,
"no-new": 2,
"no-invalid-regexp": 2,
"no-control-regex": 2,
"no-regex-spaces": 2,
"no-undef": 2,
"strict": 2,
"no-unused-vars": [2, {"vars": "all", "args": "none"}],
"semi": 2,

"no-iterator": 2,
"no-loop-func": 2,
"no-multi-str": 2,
"no-fallthrough": 2,
"no-proto": 2,
"no-script-url": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-new-require": 2,
"new-parens": 2,
"no-new-object": 2,
"no-invalid-this": 2,
"indent": [2, 4],

"valid-jsdoc": 0,
"valid-typeof": 2,

"no-trailing-spaces": [2, { "skipBlankLines": true }],
"eol-last": 2
}
}
75 changes: 0 additions & 75 deletions .jshintrc

This file was deleted.

16 changes: 9 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
* DEALINGS IN THE SOFTWARE.
*
*/
/*jslint regexp:true*/
/*global module, require, process*/

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

var common = require("./tasks/common")(grunt),
resolve = common.resolve,
platform = common.platform(),
staging;

Expand Down Expand Up @@ -202,10 +200,14 @@ module.exports = function (grunt) {
"dest" : "deps/cef"
}
},
"jshint": {
"all" : ["Gruntfile.js", "tasks/**/*.js"],
"eslint": {
"all" : [
"Gruntfile.js",
"tasks/**/*.js",
"appshell/node-core/*.js"
],
"options": {
"jshintrc" : ".jshintrc"
"quiet" : true
}
},
"build": {
Expand Down Expand Up @@ -235,7 +237,7 @@ module.exports = function (grunt) {
});

grunt.loadTasks("tasks");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-eslint");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-curl");
Expand Down
3 changes: 0 additions & 3 deletions appshell/appshell_extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
// Note: All file native file i/o functions are synchronous, but are exposed
// here as asynchronous calls.

/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, native */

var appshell;
if (!appshell) {
appshell = {};
Expand Down
28 changes: 12 additions & 16 deletions appshell/node-core/BaseDomain.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
/*
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
maxerr: 50, node: true */
/*global */

(function () {
"use strict";

Expand Down
40 changes: 20 additions & 20 deletions appshell/node-core/ConnectionManager.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
/*
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
maxerr: 50, node: true */
/*global */

(function () {
"use strict";

Expand Down Expand Up @@ -69,7 +65,7 @@ maxerr: 50, node: true */
/**
* @private
* Sends a message over the WebSocket. Called by public sendX commands.
* @param {string} type Message type. Currently supported types are
* @param {string} type Message type. Currently supported types are
"event", "commandResponse", "commandError", "error"
* @param {object} message Message body, must be JSON.stringify-able
*/
Expand Down Expand Up @@ -132,7 +128,9 @@ maxerr: 50, node: true */
if (this._ws) {
try {
this._ws.close();
} catch (e) { }
} catch (e) {
// Do nothing
}
}
this._connected = false;
_connections.splice(_connections.indexOf(this), 1);
Expand Down Expand Up @@ -182,7 +180,7 @@ maxerr: 50, node: true */
};

/**
* Sends a response indicating that an error occurred during command
* Sends a response indicating that an error occurred during command
* execution
* @param {number} id unique ID of the command that was executed. ID is
* generated by the client when the command is issued.
Expand Down Expand Up @@ -226,7 +224,9 @@ maxerr: 50, node: true */
for (i = 0; i < _connections.length; i++) {
try {
_connections[i].close();
} catch (err) { }
} catch (err) {
// Do nothing
}
}
_connections = [];
}
Expand Down
32 changes: 15 additions & 17 deletions appshell/node-core/DomainManager.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
/*
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,
maxerr: 50, node: true */
/*global */

(function () {
"use strict";

// TODO: verify if this has any side effects, and if not remove it.
require("./Server");

var util = require("util"),
server = require("./Server"),
ConnectionManager = require("./ConnectionManager");

/**
Expand Down
Loading

0 comments on commit e9b562b

Please sign in to comment.