Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
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
23 changes: 23 additions & 0 deletions .brackets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"jslint.options": {
"vars": true,
"plusplus": true,
"node": true,
"browser": false,
"devel": true,
"nomen": true,
"indent": 4,
"maxerr": 50,
"regexp": true,
"es5": true
},
"defaultExtension": "js",
"language": {
"javascript": {
"linting.prefer": ["ESLint", "JSLint"],
"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.

18 changes: 10 additions & 8 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";

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

Expand Down Expand Up @@ -205,10 +203,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 @@ -238,7 +240,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
7 changes: 0 additions & 7 deletions appshell/node-core/BaseDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*
*/

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

(function () {
"use strict";

var Launcher = require("./Launcher"),
Expand Down Expand Up @@ -137,5 +132,3 @@
}

exports.init = init;

}());
14 changes: 6 additions & 8 deletions appshell/node-core/ConnectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*
*/

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

(function () {
"use strict";

var DomainManager = require("./DomainManager");
Expand Down Expand Up @@ -132,7 +127,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 @@ -226,7 +223,9 @@ maxerr: 50, node: true */
for (i = 0; i < _connections.length; i++) {
try {
_connections[i].close();
} catch (err) { }
} catch (err) {
// Do nothing
}
}
_connections = [];
}
Expand All @@ -247,4 +246,3 @@ maxerr: 50, node: true */
exports.createConnection = createConnection;
exports.closeAllConnections = closeAllConnections;
exports.sendEventToAllConnections = sendEventToAllConnections;
}());
10 changes: 3 additions & 7 deletions appshell/node-core/DomainManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@
*
*/

/*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");

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why this change?

Expand Down Expand Up @@ -311,4 +308,3 @@ maxerr: 50, node: true */
exports.emitEvent = emitEvent;
exports.loadDomainModulesFromPaths = loadDomainModulesFromPaths;
exports.getDomainDescriptions = getDomainDescriptions;
}());
7 changes: 0 additions & 7 deletions appshell/node-core/Launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*
*/

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

(function () {
"use strict";

var Logger = require("./Logger"),
Expand Down Expand Up @@ -135,5 +130,3 @@ maxerr: 50, node: true */

exports.launch = launch;
exports.exit = exit;

}());
11 changes: 3 additions & 8 deletions appshell/node-core/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*
*/

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

(function () {
"use strict";

var fs = require("fs"),
Expand Down Expand Up @@ -73,7 +68,9 @@ maxerr: 50, node: true */

fs.appendFileSync(_logFilename,
timestampString + message + "\n");
} catch (e) { }
} catch (e) {
// Do nothing
}
}
_logHistory.push({
level: level,
Expand Down Expand Up @@ -170,5 +167,3 @@ maxerr: 50, node: true */
Logger.remapConsole = remapConsole;
Logger.getLogHistory = getLogHistory;
Logger.setLogFilename = setLogFilename;

}());
18 changes: 7 additions & 11 deletions appshell/node-core/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*
*/

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

(function () {
"use strict";

/** @define{number} Number of ms to wait for the server to start */
Expand All @@ -34,8 +29,7 @@ maxerr: 50, node: true */
/** @define{number} Number of ms between pings to parent process */
var PING_DELAY = 1000; // send ping to parent process every 1 second

var fs = require("fs"),
http = require("http"),
var http = require("http"),
WebSocket = require("./thirdparty/ws"),
EventEmitter = require("events").EventEmitter,
Logger = require("./Logger"),
Expand Down Expand Up @@ -80,12 +74,16 @@ maxerr: 50, node: true */
if (_wsServer) {
try {
_wsServer.close();
} catch (err1) { }
} catch (err1) {
// Do nothing
}
}
if (_httpServer) {
try {
_httpServer.close();
} catch (err2) { }
} catch (err2) {
// Do nothing
}
}
ConnectionManager.closeAllConnections();
Logger.info("[Server] stopped");
Expand Down Expand Up @@ -272,5 +270,3 @@ maxerr: 50, node: true */
// Public interface
Server.start = start;
Server.stop = stop;

}());
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"grunt": "0.4.1",
"grunt-cli": "0.1.6",
"grunt-contrib-jshint": "0.2.0",
"grunt-eslint": "18.1.0",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-clean": "0.4.0",
"guid": "0.0.10",
Expand Down
7 changes: 7 additions & 0 deletions tasks/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../.eslintrc.json",

"rules": {
"no-invalid-this": 0
}
}
Loading