mirror of
https://github.com/google/blockly.git
synced 2026-01-27 02:30:08 +01:00
Merge pull request #1567 from rachel-fenichel/lint/update_eslintrc
Lint/update eslintrc
This commit is contained in:
23
.eslintrc
23
.eslintrc
@@ -2,7 +2,28 @@
|
||||
"rules": {
|
||||
"curly": ["error", "multi-line"],
|
||||
"eol-last": ["error"],
|
||||
"indent": ["warn", 2, {"SwitchCase": 1}], # Blockly/Google use 2-space indents
|
||||
"indent": [
|
||||
"warn", 2, # Blockly/Google use 2-space indents
|
||||
# Blockly/Google uses +4 space indents for line continuations.
|
||||
{
|
||||
"SwitchCase": 1,
|
||||
"MemberExpression": 2,
|
||||
"ObjectExpression": 1,
|
||||
"FunctionDeclaration": {
|
||||
"body": 1,
|
||||
"parameters": 2
|
||||
},
|
||||
"FunctionExpression": {
|
||||
"body": 1,
|
||||
"parameters": 2
|
||||
},
|
||||
"CallExpression": {
|
||||
"arguments": 2
|
||||
},
|
||||
# Ignore default rules for ternary expressions.
|
||||
"ignoredNodes": ["ConditionalExpression"]
|
||||
}
|
||||
],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"max-len": ["error", 120, 4],
|
||||
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
|
||||
|
||||
@@ -1162,11 +1162,11 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) {
|
||||
var token = tokens[i];
|
||||
if (typeof token == 'number') {
|
||||
if (token <= 0 || token > args.length) {
|
||||
throw new Error('Block \"' + this.type + '\": ' +
|
||||
throw new Error('Block "' + this.type + '": ' +
|
||||
'Message index %' + token + ' out of range.');
|
||||
}
|
||||
if (indexDup[token]) {
|
||||
throw new Error('Block \"' + this.type + '\": ' +
|
||||
throw new Error('Block "' + this.type + '": ' +
|
||||
'Message index %' + token + ' duplicated.');
|
||||
}
|
||||
indexDup[token] = true;
|
||||
@@ -1180,7 +1180,7 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) {
|
||||
}
|
||||
}
|
||||
if(indexCount != args.length) {
|
||||
throw new Error('Block \"' + this.type + '\": ' +
|
||||
throw new Error('Block "' + this.type + '": ' +
|
||||
'Message does not reference all ' + args.length + ' arg(s).');
|
||||
}
|
||||
// Add last dummy input if needed.
|
||||
|
||||
@@ -388,7 +388,7 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) {
|
||||
bottom = this.addTrashcan_(bottom);
|
||||
}
|
||||
if (this.options.zoomOptions && this.options.zoomOptions.controls) {
|
||||
bottom = this.addZoomControls_(bottom);
|
||||
this.addZoomControls_(bottom);
|
||||
}
|
||||
|
||||
if (!this.isFlyout) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"jshint": "latest",
|
||||
"eslint": "2.9.0"
|
||||
"eslint": "^4.16"
|
||||
},
|
||||
"jshintConfig": {
|
||||
"globalstrict": true,
|
||||
|
||||
Reference in New Issue
Block a user