Merge pull request #1567 from rachel-fenichel/lint/update_eslintrc

Lint/update eslintrc
This commit is contained in:
Rachel Fenichel
2018-01-25 14:21:40 -08:00
committed by GitHub
4 changed files with 27 additions and 6 deletions

View File

@@ -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 }],

View File

@@ -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.

View File

@@ -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) {

View File

@@ -25,7 +25,7 @@
"private": true,
"devDependencies": {
"jshint": "latest",
"eslint": "2.9.0"
"eslint": "^4.16"
},
"jshintConfig": {
"globalstrict": true,