Skip to content

Commit

Permalink
Move most inline jslint directives to config files
Browse files Browse the repository at this point in the history
  • Loading branch information
ficristo committed Aug 12, 2016
1 parent 453cb57 commit 074382a
Show file tree
Hide file tree
Showing 409 changed files with 312 additions and 1,325 deletions.
20 changes: 19 additions & 1 deletion .brackets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@
"jslint.options": {
"vars": true,
"plusplus": true,
"browser": false,
"devel": true,
"nomen": true,
"indent": 4,
"maxerr": 50,
"es5": true
"es5": true,
"predef": [
"brackets",

"require",
"define",
"$",

"window",
"setTimeout",
"clearTimeout",

"ArrayBuffer",
"XMLHttpRequest",
"Uint32Array",
"WebSocket"
]
},
"defaultExtension": "js",
"language": {
Expand Down
16 changes: 9 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@
"globals": {
"brackets": false,

"require": false,
"define": false,
"$": false,

"window": false,
"alert": false,
"document": false,
"localStorage": false,
"navigator": false,
"setTimeout": false,
"clearTimeout": false,

"require": false,
"define": false,
"$": false
"ArrayBuffer": false,
"XMLHttpRequest": false,
"Uint32Array": false,
"WebSocket": false
}
}
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* DEALINGS IN THE SOFTWARE.
*
*/
/*global module, require*/

/*jslint node: true */

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

Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Agents/CSSAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* CSSAgent keeps track of loaded style sheets and allows reloading them
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/ConsoleAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* ConsoleAgent forwards all console message from the remote console to the
* local console.
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/DOMAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* DOMAgent constructs and maintains a tree of {DOMNode}s that represents the
* rendered DOM tree in the remote browser. Nodes can be accessed by id or
Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Agents/DOMHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* DOMHelpers is a collection of functions used by the DOMAgent exports `eachNode(src, callback)`
Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Agents/DOMNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* DOMNode represents a node in the DOM tree. It is constructed from a payload
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/EditAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* EditAgent propagates changes from the in-document editor to the source
* document.
Expand Down
3 changes: 1 addition & 2 deletions src/LiveDevelopment/Agents/GotoAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
*/


/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, brackets, $, window */
/*jslint forin: true, regexp: true */

/**
* GotoAgent constructs and responds to the in-browser goto dialog.
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/HighlightAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* HighlightAgent dispatches events for highlight requests from in-browser
* highlight requests, and allows highlighting nodes and rules in the browser.
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/NetworkAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* NetworkAgent tracks all resources loaded by the remote debugger. Use
* `wasURLRequested(url)` to query whether a resource was loaded.
Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Agents/RemoteAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* RemoteAgent defines and provides an interface for custom remote functions
Expand Down
52 changes: 25 additions & 27 deletions src/LiveDevelopment/Agents/RemoteFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
*
*/


/*jslint vars: true, plusplus: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*jshint unused: false */
/*global window, navigator, Node, console */
/*jslint forin: true */
/*global Node */
/*theseus instrument: false */

/**
Expand All @@ -47,7 +45,7 @@ function RemoteFunctions(experimental) {

// determine whether an event should be processed for Live Development
function _validEvent(event) {
if (navigator.platform.substr(0, 3) === "Mac") {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
Expand Down Expand Up @@ -127,7 +125,7 @@ function RemoteFunctions(experimental) {
y = offset.top + this.element.offsetHeight;

// create the container
this.body = document.createElement("div");
this.body = window.document.createElement("div");
this.body.style.setProperty("z-index", 2147483647);
this.body.style.setProperty("position", "absolute");
this.body.style.setProperty("left", x + "px");
Expand All @@ -143,7 +141,7 @@ function RemoteFunctions(experimental) {
},

addItem: function (target) {
var item = document.createElement("div");
var item = window.document.createElement("div");
item.style.setProperty("padding", "2px 6px");
if (this.body.childNodes.length > 0) {
item.style.setProperty("border-top", "1px solid #ccc");
Expand All @@ -154,7 +152,7 @@ function RemoteFunctions(experimental) {
item.addEventListener("click", this.onClick.bind(this, target.url));

if (target.file) {
var file = document.createElement("i");
var file = window.document.createElement("i");
file.style.setProperty("float", "right");
file.style.setProperty("margin-left", "12px");
file.innerHTML = " " + target.file;
Expand All @@ -168,16 +166,16 @@ function RemoteFunctions(experimental) {
this.body = this.createBody();
}
if (!this.body.parentNode) {
document.body.appendChild(this.body);
window.document.body.appendChild(this.body);
}
document.addEventListener("click", this.remove);
window.document.addEventListener("click", this.remove);
},

remove: function () {
if (this.body && this.body.parentNode) {
document.body.removeChild(this.body);
window.document.body.removeChild(this.body);
}
document.removeEventListener("click", this.remove);
window.document.removeEventListener("click", this.remove);
}

};
Expand Down Expand Up @@ -315,7 +313,7 @@ function RemoteFunctions(experimental) {
},

add: function (element, doAnimation) {
if (this._elementExists(element) || element === document) {
if (this._elementExists(element) || element === window.document) {
return;
}
if (this.trigger) {
Expand Down Expand Up @@ -395,7 +393,7 @@ function RemoteFunctions(experimental) {

function onMouseMove(event) {
onMouseOver(event);
document.removeEventListener("mousemove", onMouseMove);
window.document.removeEventListener("mousemove", onMouseMove);
}

function onClick(event) {
Expand All @@ -412,11 +410,11 @@ function RemoteFunctions(experimental) {

function onKeyUp(event) {
if (_setup && !_validEvent(event)) {
document.removeEventListener("keyup", onKeyUp);
document.removeEventListener("mouseover", onMouseOver);
document.removeEventListener("mouseout", onMouseOut);
document.removeEventListener("mousemove", onMouseMove);
document.removeEventListener("click", onClick);
window.document.removeEventListener("keyup", onKeyUp);
window.document.removeEventListener("mouseover", onMouseOver);
window.document.removeEventListener("mouseout", onMouseOut);
window.document.removeEventListener("mousemove", onMouseMove);
window.document.removeEventListener("click", onClick);
_localHighlight.clear();
_localHighlight = undefined;
_setup = false;
Expand All @@ -425,11 +423,11 @@ function RemoteFunctions(experimental) {

function onKeyDown(event) {
if (!_setup && _validEvent(event)) {
document.addEventListener("keyup", onKeyUp);
document.addEventListener("mouseover", onMouseOver);
document.addEventListener("mouseout", onMouseOut);
document.addEventListener("mousemove", onMouseMove);
document.addEventListener("click", onClick);
window.document.addEventListener("keyup", onKeyUp);
window.document.addEventListener("mouseover", onMouseOver);
window.document.addEventListener("mouseout", onMouseOut);
window.document.addEventListener("mousemove", onMouseMove);
window.document.addEventListener("click", onClick);
_localHighlight = new Highlight("#ecc", true);
_setup = true;
}
Expand Down Expand Up @@ -479,7 +477,7 @@ function RemoteFunctions(experimental) {
// highlight a rule
function highlightRule(rule) {
hideHighlight();
var i, nodes = document.querySelectorAll(rule);
var i, nodes = window.document.querySelectorAll(rule);
for (i = 0; i < nodes.length; i++) {
highlight(nodes[i]);
}
Expand All @@ -500,7 +498,7 @@ function RemoteFunctions(experimental) {
function _scrollHandler(e) {
// Document scrolls can be updated immediately. Any other scrolls
// need to be updated on a timer to ensure the layout is correct.
if (e.target === document) {
if (e.target === window.document) {
redrawHighlights();
} else {
if (_remoteHighlight || _localHighlight) {
Expand Down Expand Up @@ -817,7 +815,7 @@ function RemoteFunctions(experimental) {
}

function getSimpleDOM() {
return JSON.stringify(_domElementToJSON(document.documentElement));
return JSON.stringify(_domElementToJSON(window.document.documentElement));
}

// init
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Agents/ScriptAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* ScriptAgent tracks all executed scripts, defines internal breakpoints, and
* interfaces with the remote debugger.
Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Documents/CSSDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* CSSDocument manages a single CSS source document
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Documents/CSSPreprocessorDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* CSSPreprocessorDocument manages a single LESS or SASS source document
*
Expand Down
4 changes: 0 additions & 4 deletions src/LiveDevelopment/Documents/HTMLDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*
*/


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

/**
* HTMLDocument manages a single HTML source document
*
Expand Down
4 changes: 1 addition & 3 deletions src/LiveDevelopment/Documents/JSDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*
*/


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

/**
* JSDocument manages a single JavaScript source document
Expand Down
6 changes: 2 additions & 4 deletions src/LiveDevelopment/Inspector/Inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
*
*/



/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, $, WebSocket, FileError, XMLHttpRequest */
/*jslint forin: true */
/*global FileError */

/**
* Inspector manages the connection to Chrome/Chromium's remote debugger.
Expand Down
Loading

0 comments on commit 074382a

Please sign in to comment.