remove confusing globals from eslint config

pull/483/head
nightwing 2018-02-10 20:23:07 +04:00
rodzic a89660aac1
commit 4df145f35b
13 zmienionych plików z 68 dodań i 28 usunięć

Wyświetl plik

@ -3,13 +3,44 @@ ecmaFeatures:
env:
node: true
browser: true
amd: true
builtin: true
mocha: true
jasmine: false
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:
- react
@ -103,3 +134,14 @@ rules:
no-multi-spaces: 1
no-lone-blocks: 1
// 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 }]

Wyświetl plik

@ -64,7 +64,7 @@ define(function(require, exports, module) {
var targets = {};
function getWorkspace(wsname, callback) {
emit("connecting", { wspath: wspath });
emit("connecting", { wsname: wsname });
workspace.connect(wsname, function(err, ws) {
ws.setupSshConnection(function(err) {
@ -247,7 +247,7 @@ define(function(require, exports, module) {
});
plugin.on("unload", function() {
loaded = false;
});
/***** Register and define API *****/

Wyświetl plik

@ -1,3 +1,4 @@
/*global apf*/
define(function(require, exports, module) {
main.consumes = ["app"];
main.provides = ["ext", "Plugin"];
@ -157,6 +158,7 @@ define(function(require, exports, module) {
}
function unloadRemotePlugin(id, options, callback) {
var vfs = architectApp.services.vfs;
if (typeof options == "function") {
callback = options;
options = {};

Wyświetl plik

@ -115,7 +115,7 @@ define(function(require, module, exports) {
try {
data = JSON.parse(data);
} 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) {
if (typeof XMLHttpRequestProgressEvent == "function" && e instanceof XMLHttpRequestProgressEvent) {
// No useful information in this object.
// Possibly CORS error if code was 0.
var err = new Error("Failed to retrieve resource from " + parsedUrl.host);
err.cause = e;
err.code = e.target.status;
return done(err);
}
e.code = e.target.status;
done(e);
};
// No useful information in this object. Possibly CORS error if code was 0.
var code = e.target.status;
var err = new Error("Failed to retrieve resource from " + parsedUrl.href + " with code " + code);
err.cause = e;
err.code = code;
return done(err);
};
var called = false;
function done(err, data, res) {
@ -196,9 +192,10 @@ define(function(require, module, exports) {
function parseHeaders(headerString) {
return headerString
.split('\u000d\u000a')
.trim() // on ie11 header string can start with single \n
.split("\r\n")
.reduce(function(headers, headerPair) {
var index = headerPair.indexOf('\u003a\u0020');
var index = headerPair.indexOf(": ");
if (index > 0) {
var key = headerPair.substring(0, index).toLowerCase();
var val = headerPair.substring(index + 2);

Wyświetl plik

@ -1680,7 +1680,6 @@ define(function(require, exports, module) {
mnuContext = null;
mnuEditors = null;
mnuTabs = null;
accessedTab = null;
paneList = null;
accessedPane = null;
cycleKeyPressed = null;

Wyświetl plik

@ -1,4 +1,4 @@
/*global describe it before after = */
/*global describe it before after bar */
"use client";

Wyświetl plik

@ -1,4 +1,4 @@
/*global describe it before disabledFeatures*/
/*global describe, it, before, disabledFeatures:true*/
"use client";

Wyświetl plik

@ -33,7 +33,7 @@ function Heap(param) {
};
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];
};
@ -43,7 +43,7 @@ function Heap(param) {
};
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);
var min = this.pq.splice(this.pq.length - 1, 1)[0];
this.sink(1);

Wyświetl plik

@ -1,4 +1,4 @@
/*global describe it before after bar bar2 */
/*global describe it before after bar */
"use client";
@ -43,7 +43,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
var layout = imports.layout;
var emitter = require("events").EventEmitter;
var bar2;
var p = [];

Wyświetl plik

@ -1,4 +1,4 @@
/*global describe it before after = */
/*global describe it before after bar */
"use client";

Wyświetl plik

@ -666,7 +666,7 @@ define(function(require, exports, module) {
}, function(err, p) {
if (err) return cb(err);
process = p.process;
var process = p.process;
var stderr = "";
var stdout = "";
process.stdout.on("data", function(e) {

Wyświetl plik

@ -187,7 +187,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
fileEntry.file(function(file) {
file.entry = fileEntry;
next(null, file);
}, onerror);
}, next);
};
fileWriter.onerror = next;

Wyświetl plik

@ -1,4 +1,4 @@
/*global describe it before after */
/*global describe it before after bar */
"use client";