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