mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Update eslintrc for eslint v7, and resolve new lint errors
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
"rules": {
|
||||
"curly": ["error"],
|
||||
"eol-last": ["error"],
|
||||
"_comment": "Blockly/Google use 2-space indents",
|
||||
"_comment": "Blockly/Google uses +4 space indents for line continuations.",
|
||||
"_comment": "Ignore default rules for ternary expressions.",
|
||||
// Blockly/Google use 2-space indents.
|
||||
// Blockly/Google uses +4 space indents for line continuations.
|
||||
// Ignore default rules for ternary expressions.
|
||||
"indent": [
|
||||
"error", 2,
|
||||
{
|
||||
@@ -42,26 +42,26 @@
|
||||
"error",
|
||||
{
|
||||
"args": "after-used",
|
||||
"_comment": "Ignore vars starting with an underscore.",
|
||||
// Ignore vars starting with an underscore.
|
||||
"varsIgnorePattern": "^_",
|
||||
"_comment": "Ignore arguments starting with an underscore.",
|
||||
// Ignore arguments starting with an underscore.
|
||||
"argsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"no-use-before-define": ["error"],
|
||||
"_comment":"Blockly uses for exporting symbols. no-self-assign added in eslint 5.",
|
||||
// Blockly uses for exporting symbols. no-self-assign added in eslint 5.
|
||||
"no-self-assign": ["off"],
|
||||
"_comment": "Blockly uses single quotes except for JSON blobs, which must use double quotes.",
|
||||
// Blockly uses single quotes except for JSON blobs, which must use double quotes.
|
||||
"quotes": ["off"],
|
||||
"semi": ["error", "always"],
|
||||
"_comment": "Blockly doesn't have space before function paren when defining functions",
|
||||
// Blockly doesn't have space before function paren when defining functions.
|
||||
"space-before-function-paren": ["error", "never"],
|
||||
"_comment": "Blocklydoesn't have space before function paren when calling functions",
|
||||
// Blockly doesn't have space before function paren when calling functions.
|
||||
"func-call-spacing": ["error", "never"],
|
||||
"space-infix-ops": ["error"],
|
||||
"_comment": "Blockly uses 'use strict' in files",
|
||||
// Blockly uses 'use strict' in files.
|
||||
"strict": ["off"],
|
||||
"_comment": "Closure style allows redeclarations",
|
||||
// Closure style allows redeclarations.
|
||||
"no-redeclare": ["off"],
|
||||
"valid-jsdoc": ["error", {"requireReturn": false}],
|
||||
"no-console": ["off"],
|
||||
|
||||
@@ -83,7 +83,7 @@ Blockly.blockRendering.Types.nextTypeValue_ = 1 << 24;
|
||||
* @package
|
||||
*/
|
||||
Blockly.blockRendering.Types.getType = function(type) {
|
||||
if (!Blockly.blockRendering.Types.hasOwnProperty(type)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(Blockly.blockRendering.Types, type)) {
|
||||
Blockly.blockRendering.Types[type] =
|
||||
Blockly.blockRendering.Types.nextTypeValue_;
|
||||
Blockly.blockRendering.Types.nextTypeValue_ <<= 1;
|
||||
|
||||
@@ -487,7 +487,7 @@ Blockly.Xml.appendDomToWorkspace = function(xml, workspace) {
|
||||
var bbox; // Bounding box of the current blocks.
|
||||
// First check if we have a workspaceSvg, otherwise the blocks have no shape
|
||||
// and the position does not matter.
|
||||
if (workspace.hasOwnProperty('scale')) {
|
||||
if (Object.prototype.hasOwnProperty.call(workspace, 'scale')) {
|
||||
bbox = workspace.getBlocksBoundingBox();
|
||||
}
|
||||
// Load the new blocks into the workspace and get the IDs of the new blocks.
|
||||
|
||||
@@ -241,8 +241,8 @@ suite('Extensions', function() {
|
||||
// Make sure all of the functions were installed correctly.
|
||||
chai.assert.equal(block.domToMutation(), 'domToMutationFn');
|
||||
chai.assert.equal(block.mutationToDom(), 'mutationToDomFn');
|
||||
chai.assert.isFalse(block.hasOwnProperty('compose'));
|
||||
chai.assert.isFalse(block.hasOwnProperty('decompose'));
|
||||
chai.assert.isFalse(Object.prototype.hasOwnProperty.call(block, 'compose'));
|
||||
chai.assert.isFalse(Object.prototype.hasOwnProperty.call(block, 'decompose'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user