kopia lustrzana https://github.com/c9/core
remove confusing globals from eslint config
rodzic
a89660aac1
commit
4df145f35b
44
.eslintrc
44
.eslintrc
|
@ -3,13 +3,44 @@ ecmaFeatures:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
node: true
|
node: true
|
||||||
browser: true
|
|
||||||
amd: true
|
amd: true
|
||||||
builtin: true
|
builtin: true
|
||||||
mocha: true
|
mocha: true
|
||||||
jasmine: false
|
jasmine: false
|
||||||
es6: true
|
es6: true
|
||||||
|
|
||||||
|
globals:
|
||||||
|
importScripts: true
|
||||||
|
document: true
|
||||||
|
window: true
|
||||||
|
location: true
|
||||||
|
navigator: true
|
||||||
|
console: true
|
||||||
|
Worker: true
|
||||||
|
postMessage: true
|
||||||
|
setTimeout: true
|
||||||
|
clearTimeout: true
|
||||||
|
setInterval: true
|
||||||
|
clearInterval: true
|
||||||
|
Blob: true
|
||||||
|
XMLHttpRequest: true
|
||||||
|
localStorage: true
|
||||||
|
requestAnimationFrame: true
|
||||||
|
KeyboardEvent: true
|
||||||
|
onload: true # for tests
|
||||||
|
btoa: true
|
||||||
|
atob: true
|
||||||
|
apf: true
|
||||||
|
alert: true
|
||||||
|
prompt: true
|
||||||
|
Image: true
|
||||||
|
URL: true
|
||||||
|
FileReader: true
|
||||||
|
FileReaderSync: true
|
||||||
|
WebSocket: true
|
||||||
|
sessionStorage: true
|
||||||
|
localStorage: true
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
- react
|
- react
|
||||||
|
|
||||||
|
@ -103,3 +134,14 @@ rules:
|
||||||
no-multi-spaces: 1
|
no-multi-spaces: 1
|
||||||
no-lone-blocks: 1
|
no-lone-blocks: 1
|
||||||
// valid-jsdoc: [1, { requireReturn: false, requireParamDescription: false, prefer: { "return": "return" } }]
|
// valid-jsdoc: [1, { requireReturn: false, requireParamDescription: false, prefer: { "return": "return" } }]
|
||||||
|
no-empty: [1, {"allowEmptyCatch": true}]
|
||||||
|
no-useless-escape: [0] // broken for regexps
|
||||||
|
no-ex-assign: 0
|
||||||
|
no-fallthrough: 0
|
||||||
|
no-sparse-arrays: 0
|
||||||
|
no-control-regex: 0
|
||||||
|
no-unsafe-finally: 0
|
||||||
|
no-mixed-spaces-and-tabs: 0
|
||||||
|
no-constant-condition: [1, { "checkLoops": false }]
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ define(function(require, exports, module) {
|
||||||
var targets = {};
|
var targets = {};
|
||||||
|
|
||||||
function getWorkspace(wsname, callback) {
|
function getWorkspace(wsname, callback) {
|
||||||
emit("connecting", { wspath: wspath });
|
emit("connecting", { wsname: wsname });
|
||||||
|
|
||||||
workspace.connect(wsname, function(err, ws) {
|
workspace.connect(wsname, function(err, ws) {
|
||||||
ws.setupSshConnection(function(err) {
|
ws.setupSshConnection(function(err) {
|
||||||
|
@ -247,7 +247,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
});
|
});
|
||||||
plugin.on("unload", function() {
|
plugin.on("unload", function() {
|
||||||
loaded = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/***** Register and define API *****/
|
/***** Register and define API *****/
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*global apf*/
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
main.consumes = ["app"];
|
main.consumes = ["app"];
|
||||||
main.provides = ["ext", "Plugin"];
|
main.provides = ["ext", "Plugin"];
|
||||||
|
@ -157,6 +158,7 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unloadRemotePlugin(id, options, callback) {
|
function unloadRemotePlugin(id, options, callback) {
|
||||||
|
var vfs = architectApp.services.vfs;
|
||||||
if (typeof options == "function") {
|
if (typeof options == "function") {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
|
|
|
@ -115,7 +115,7 @@ define(function(require, module, exports) {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return done(e);
|
return done(new Error("JSON parsing error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,17 +131,13 @@ define(function(require, module, exports) {
|
||||||
};
|
};
|
||||||
|
|
||||||
xhr.onerror = function(e) {
|
xhr.onerror = function(e) {
|
||||||
if (typeof XMLHttpRequestProgressEvent == "function" && e instanceof XMLHttpRequestProgressEvent) {
|
// No useful information in this object. Possibly CORS error if code was 0.
|
||||||
// No useful information in this object.
|
var code = e.target.status;
|
||||||
// Possibly CORS error if code was 0.
|
var err = new Error("Failed to retrieve resource from " + parsedUrl.href + " with code " + code);
|
||||||
var err = new Error("Failed to retrieve resource from " + parsedUrl.host);
|
err.cause = e;
|
||||||
err.cause = e;
|
err.code = code;
|
||||||
err.code = e.target.status;
|
return done(err);
|
||||||
return done(err);
|
};
|
||||||
}
|
|
||||||
e.code = e.target.status;
|
|
||||||
done(e);
|
|
||||||
};
|
|
||||||
|
|
||||||
var called = false;
|
var called = false;
|
||||||
function done(err, data, res) {
|
function done(err, data, res) {
|
||||||
|
@ -196,9 +192,10 @@ define(function(require, module, exports) {
|
||||||
|
|
||||||
function parseHeaders(headerString) {
|
function parseHeaders(headerString) {
|
||||||
return headerString
|
return headerString
|
||||||
.split('\u000d\u000a')
|
.trim() // on ie11 header string can start with single \n
|
||||||
|
.split("\r\n")
|
||||||
.reduce(function(headers, headerPair) {
|
.reduce(function(headers, headerPair) {
|
||||||
var index = headerPair.indexOf('\u003a\u0020');
|
var index = headerPair.indexOf(": ");
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
var key = headerPair.substring(0, index).toLowerCase();
|
var key = headerPair.substring(0, index).toLowerCase();
|
||||||
var val = headerPair.substring(index + 2);
|
var val = headerPair.substring(index + 2);
|
||||||
|
|
|
@ -1680,7 +1680,6 @@ define(function(require, exports, module) {
|
||||||
mnuContext = null;
|
mnuContext = null;
|
||||||
mnuEditors = null;
|
mnuEditors = null;
|
||||||
mnuTabs = null;
|
mnuTabs = null;
|
||||||
accessedTab = null;
|
|
||||||
paneList = null;
|
paneList = null;
|
||||||
accessedPane = null;
|
accessedPane = null;
|
||||||
cycleKeyPressed = null;
|
cycleKeyPressed = null;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global describe it before after = */
|
/*global describe it before after bar */
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global describe it before disabledFeatures*/
|
/*global describe, it, before, disabledFeatures:true*/
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ function Heap(param) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.min = function() {
|
this.min = function() {
|
||||||
if (this.empty()) throw new Exception("Priority queue underflow");
|
if (this.empty()) throw new Error("Priority queue underflow");
|
||||||
return this.pq[1];
|
return this.pq[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function Heap(param) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.pop = function() {
|
this.pop = function() {
|
||||||
if (this.empty()) throw new Exception("Priority queue underflow");
|
if (this.empty()) throw new Error("Priority queue underflow");
|
||||||
this.$exch(1, this.N);
|
this.$exch(1, this.N);
|
||||||
var min = this.pq.splice(this.pq.length - 1, 1)[0];
|
var min = this.pq.splice(this.pq.length - 1, 1)[0];
|
||||||
this.sink(1);
|
this.sink(1);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global describe it before after bar bar2 */
|
/*global describe it before after bar */
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
||||||
var layout = imports.layout;
|
var layout = imports.layout;
|
||||||
|
|
||||||
var emitter = require("events").EventEmitter;
|
var emitter = require("events").EventEmitter;
|
||||||
|
var bar2;
|
||||||
|
|
||||||
var p = [];
|
var p = [];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global describe it before after = */
|
/*global describe it before after bar */
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
|
@ -666,7 +666,7 @@ define(function(require, exports, module) {
|
||||||
}, function(err, p) {
|
}, function(err, p) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
process = p.process;
|
var process = p.process;
|
||||||
var stderr = "";
|
var stderr = "";
|
||||||
var stdout = "";
|
var stdout = "";
|
||||||
process.stdout.on("data", function(e) {
|
process.stdout.on("data", function(e) {
|
||||||
|
|
|
@ -187,7 +187,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
||||||
fileEntry.file(function(file) {
|
fileEntry.file(function(file) {
|
||||||
file.entry = fileEntry;
|
file.entry = fileEntry;
|
||||||
next(null, file);
|
next(null, file);
|
||||||
}, onerror);
|
}, next);
|
||||||
};
|
};
|
||||||
fileWriter.onerror = next;
|
fileWriter.onerror = next;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global describe it before after */
|
/*global describe it before after bar */
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue