Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint rule updates #1716

Merged
merged 2 commits into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@
"ignoredNodes": ["ConditionalExpression"]
}
],
"keyword-spacing": ["error"],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 4],
"max-len": [
"error",
{
"code": 100,
"tabWidth": 4,
"ignoreStrings": true,
"ignoreRegExpLiterals": true
}
],
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
"no-unused-vars": ["error", {"args": "after-used", "varsIgnorePattern": "^_"}],
"no-use-before-define": ["error"],
Expand Down
2 changes: 1 addition & 1 deletion blocks/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = {
* @this Blockly.Block
*/
customContextMenu: function(options) {
if(this.isInFlyout){
if (this.isInFlyout){
return;
}
// Getter blocks have the option to create a setter block, and vice versa.
Expand Down
2 changes: 1 addition & 1 deletion core/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) {
}
}
}
if(indexCount != args.length) {
if (indexCount != args.length) {
throw new Error('Block "' + this.type + '": ' +
'Message does not reference all ' + args.length + ' arg(s).');
}
Expand Down
2 changes: 1 addition & 1 deletion core/flyout_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ Blockly.Flyout.prototype.createBlock = function(originalBlock) {
Blockly.Events.setGroup(true);
Blockly.Events.fire(new Blockly.Events.Create(newBlock));
// Fire a VarCreate event for each (if any) new variable created.
for(var i = 0; i < newVariables.length; i++) {
for (var i = 0; i < newVariables.length; i++) {
var thisVariable = newVariables[i];
Blockly.Events.fire(new Blockly.Events.VarCreate(thisVariable));
}
Expand Down
3 changes: 2 additions & 1 deletion core/touch_gesture.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ Blockly.TouchGesture.prototype.handleTouchMove = function(e) {
gestureScale * Blockly.TouchGesture.ZOOM_IN_MULTIPLIER :
gestureScale * Blockly.TouchGesture.ZOOM_OUT_MULTIPLIER;
var workspace = this.startWorkspace_;
var position = Blockly.utils.mouseToSvg(e, workspace.getParentSvg(), workspace.getInverseScreenCTM());
var position = Blockly.utils.mouseToSvg(
e, workspace.getParentSvg(), workspace.getInverseScreenCTM());
workspace.zoom(position.x, position.y, delta);
}
this.previousScale_ = scale;
Expand Down
2 changes: 1 addition & 1 deletion core/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ Blockly.Xml.domToBlock = function(xmlBlock, workspace) {
var newVariables = Blockly.Variables.getAddedVariables(workspace,
variablesBeforeCreation);
// Fire a VarCreate event for each (if any) new variable created.
for(var i = 0; i < newVariables.length; i++) {
for (var i = 0; i < newVariables.length; i++) {
var thisVariable = newVariables[i];
Blockly.Events.fire(new Blockly.Events.VarCreate(thisVariable));
}
Expand Down