Skip to content

Commit 46549ee

Browse files
authored
ESLint: enable block-spacing rule and did a little cleanup (#131)
1 parent 526aae9 commit 46549ee

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.eslintignore

-1
This file was deleted.

.eslintrc.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
// http://eslint.org/docs/rules/#nodejs-and-commonjs
6969
"no-new-require": "error",
7070
// http://eslint.org/docs/rules/#stylistic-issues
71-
"block-spacing": "warn",
71+
"block-spacing": "error",
7272
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
7373
"camelcase": "warn",
7474
"comma-dangle": "error",
@@ -142,6 +142,13 @@ module.exports = {
142142
"XMLHttpRequest": false
143143
},
144144
"overrides": [
145+
// src/
146+
{
147+
"files": [ "src/**" ],
148+
"globals": {
149+
"electron": false
150+
}
151+
},
145152
// TypeScript
146153
{
147154
"files": [ "**/*.ts" ],

src/.eslintrc.js

-5
This file was deleted.

src/extensions/default/CodeFolding/foldhelpers/foldgutter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ define(function (require, exports, module) {
260260
* @param {!Object} changeObj detailed information about the change that occurred in the document
261261
*/
262262
function onChange(cm, changeObj) {
263-
if (changeObj.origin === "setValue") {//text content has changed outside of brackets
263+
if (changeObj.origin === "setValue") { // text content has changed outside of brackets
264264
var folds = cm.getValidFolds(cm._lineFolds);
265265
cm._lineFolds = folds;
266266
Object.keys(folds).forEach(function (line) {

src/extensions/default/NavigationAndHistory/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ define(function (require, exports, module) {
185185
* @private
186186
*/
187187
function _syncWithFileSystem() {
188-
_mrofList = _mrofList.filter(function (e) {return e; });
188+
_mrofList = _mrofList.filter(function (e) { return e; });
189189
return Async.doSequentially(_mrofList, _checkExt, false);
190190
}
191191

@@ -431,7 +431,7 @@ define(function (require, exports, module) {
431431
}
432432

433433
_syncWithFileSystem().always(function () {
434-
_mrofList = _mrofList.filter(function (e) {return e; });
434+
_mrofList = _mrofList.filter(function (e) { return e; });
435435
_createFileEntries($mrofList);
436436
var $fileLinks = $("#mrof-container #mrof-list > li > a.mroitem");
437437
// Handlers for mouse events on the list items
@@ -705,7 +705,7 @@ define(function (require, exports, module) {
705705
});
706706

707707
// Clean the null/undefined entries
708-
_mrofList = _mrofList.filter(function (e) {return e; });
708+
_mrofList = _mrofList.filter(function (e) { return e; });
709709

710710
PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true);
711711
}

test/spec/MainViewManager-test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ define(function (require, exports, module) {
198198
expect(MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE)).toBeFalsy();
199199
});
200200
runs(function () {
201-
expect(function () {MainViewManager.setActivePaneId("second-pane"); }).toThrow();
201+
expect(function () { MainViewManager.setActivePaneId("second-pane"); }).toThrow();
202202
expect(MainViewManager.getActivePaneId()).toNotEqual("second-pane");
203203
});
204204
runs(function () {
205-
expect(function () {MainViewManager.addToWorkingSet("second-pane", getFileObject("test.js")); }).toThrow();
205+
expect(function () { MainViewManager.addToWorkingSet("second-pane", getFileObject("test.js")); }).toThrow();
206206
expect(MainViewManager.findInWorkingSet(MainViewManager.ALL_PANES, testPath + "/test.js")).toEqual(-1);
207-
expect(function () {MainViewManager.findInWorkingSet("second-pane", testPath + "/test.js"); }).toThrow();
207+
expect(function () { MainViewManager.findInWorkingSet("second-pane", testPath + "/test.js"); }).toThrow();
208208
});
209209
runs(function () {
210-
expect(function () {MainViewManager.addListToWorkingSet("second-pane", [getFileObject("test.js")]); }).toThrow();
210+
expect(function () { MainViewManager.addListToWorkingSet("second-pane", [getFileObject("test.js")]); }).toThrow();
211211
expect(MainViewManager.findInWorkingSet(MainViewManager.ALL_PANES, testPath + "/test.js")).toEqual(-1);
212-
expect(function () {MainViewManager.findInWorkingSet("second-pane", testPath + "/test.js"); }).toThrow();
212+
expect(function () { MainViewManager.findInWorkingSet("second-pane", testPath + "/test.js"); }).toThrow();
213213
});
214214
});
215215
});

0 commit comments

Comments
 (0)