mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-05 10:05:18 +02:00
fix eslint errors.
This commit is contained in:
parent
ba0f8d02a1
commit
75a57bca03
@ -79,7 +79,7 @@
|
||||
"newline-per-chained-call": "error",
|
||||
"no-alert": "error",
|
||||
"no-array-constructor": "error",
|
||||
"no-bitwise": "error",
|
||||
"no-bitwise": "off",
|
||||
"no-caller": "error",
|
||||
"no-console": "off",
|
||||
"no-catch-shadow": "error",
|
||||
@ -164,7 +164,7 @@
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-use-before-define": "error",
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-concat": "off",
|
||||
@ -173,7 +173,7 @@
|
||||
"no-useless-rename": "error",
|
||||
"no-var": "off",
|
||||
"no-void": "error",
|
||||
"no-warning-comments": "error",
|
||||
"no-warning-comments": "off",
|
||||
"no-whitespace-before-property": "error",
|
||||
"no-with": "error",
|
||||
"object-curly-spacing": [
|
||||
@ -259,6 +259,9 @@
|
||||
"marked": true,
|
||||
"jade": true,
|
||||
"loadJS": true,
|
||||
"esprima": true,
|
||||
"escodegen": true,
|
||||
"utils": true,
|
||||
"Promise": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
var noticationContainerEL = $('#js-alerts-container');
|
||||
|
||||
function addNotification(msg) {
|
||||
var n = document.createElement('div');
|
||||
//var n = document.createElement('div');
|
||||
// div.textContent = msg;
|
||||
// noticationContainerEL.appendChild(n);
|
||||
noticationContainerEL.textContent = msg;
|
||||
@ -17,4 +17,4 @@
|
||||
window.alertsService = {
|
||||
add: addNotification
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-extra-semi */
|
||||
;(function () {
|
||||
;(function (alertsService) {
|
||||
|
||||
/* eslint-enable no-extra-semi */
|
||||
var editur = window.editur || {};
|
||||
@ -154,12 +154,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
function populateItem(items) {
|
||||
// currentItem = savedItems[];
|
||||
refreshEditor();
|
||||
}
|
||||
function populateItemsInSavedPane(items) {
|
||||
if (!items || !items.length) return;
|
||||
if (!items || !items.length) { return; }
|
||||
var html = '';
|
||||
// TODO: sort desc. by updation date
|
||||
items.sort(function (a, b) {
|
||||
@ -282,9 +278,11 @@
|
||||
editur.cm.js.setOption('mode', modes[value].cmMode);
|
||||
CodeMirror.autoLoadMode(editur.cm.js, modes[value].cmMode);
|
||||
// FIXME: Will be saved as part of global settings
|
||||
/*chrome.storage.sync.set({
|
||||
/*
|
||||
chrome.storage.sync.set({
|
||||
jsMode: value
|
||||
}, function () {});*/
|
||||
}, function () {});
|
||||
*/
|
||||
}
|
||||
|
||||
// computeHtml, computeCss & computeJs evaluate the final code according
|
||||
@ -340,7 +338,7 @@
|
||||
tolerant: true
|
||||
});
|
||||
} catch(e) {
|
||||
showErrors('js', [ { lineNumber: e.lineNumber-1, message: e.description } ]);
|
||||
showErrors('js', [ { lineNumber: e.lineNumber - 1, message: e.description } ]);
|
||||
} finally {
|
||||
utils.addInfiniteLoopProtection(ast);
|
||||
d.resolve(escodegen.generate(ast));
|
||||
@ -364,7 +362,7 @@
|
||||
tolerant: true
|
||||
});
|
||||
} catch(e) {
|
||||
showErrors('js', [ { lineNumber: e.lineNumber-1, message: e.description } ]);
|
||||
showErrors('js', [ { lineNumber: e.lineNumber - 1, message: e.description } ]);
|
||||
} finally {
|
||||
utils.addInfiniteLoopProtection(ast);
|
||||
d.resolve(Babel.transform(escodegen.generate(ast), { presets: ['es2015'] }).code);
|
||||
@ -639,9 +637,9 @@
|
||||
}, function syncGetCallback(result) {
|
||||
if (result.preserveLastCode && lastCode) {
|
||||
if (lastCode.id) {
|
||||
chrome.storage.local.get(lastCode.id, function (result) {
|
||||
chrome.storage.local.get(lastCode.id, function (itemResult) {
|
||||
utils.log('Load item ', lastCode.id)
|
||||
currentItem = result[lastCode.id];
|
||||
currentItem = itemResult[lastCode.id];
|
||||
refreshEditor();
|
||||
});
|
||||
} else {
|
||||
@ -671,4 +669,4 @@
|
||||
|
||||
init();
|
||||
|
||||
})();
|
||||
})(window.alertsService);
|
||||
|
@ -50,6 +50,7 @@
|
||||
inside: ast2.body[0].body.body[0]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add timed limit on the loops found in the passed AST body
|
||||
* @param {ASTBody} Body of an AST generated by esprima or any ES compliant AST
|
||||
|
Loading…
x
Reference in New Issue
Block a user