From 9072563a00f68bad3b00d12bd4f1cd5e8cd54ff3 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 16 Jan 2018 16:43:22 -0800 Subject: [PATCH] Update eslintrc to more explicitly describe indentation rules. --- .eslintrc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 320df11ae..ff27be4e0 100644 --- a/.eslintrc +++ b/.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": [ + "error", 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 }],