Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Indent continuation lines at least 4 spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Aug 30, 2018
1 parent 394bf3c commit 1fdcfc2
Show file tree
Hide file tree
Showing 5 changed files with 560 additions and 168 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
@@ -1,4 +1,3 @@
language: node_js
node_js:
- '5'
- '4'
- 'lts/*'
42 changes: 31 additions & 11 deletions index.js
Expand Up @@ -81,9 +81,9 @@ module.exports = {
// 'class-methods-use-this': 0,
// 'complexity': 0,
// 'consistent-return': 0
'curly': [2, 'multi-line'], // TODO(philipwalton): add an option to enforce
// braces with the exception of simple,
// single-line if statements.
// TODO(philipwalton): add an option to enforce braces with the
// exception of simple, single-line if statements.
'curly': [2, 'multi-line'],
// 'default-case': 0,
// 'dot-location': 0,
// 'dot-notation': 0,
Expand Down Expand Up @@ -205,8 +205,27 @@ module.exports = {
// 'id-blacklist': 0,
// 'id-length': 0,
// 'id-match': 0,
// 'indent': 0, // TODO(philipwalton): this rule isn't compatible with
// Google's 4-space indent for line continuations.
'indent': [
'error', 2, {
'CallExpression': {
'arguments': 2,
},
'FunctionDeclaration': {
'body': 1,
'parameters': 2,
},
'FunctionExpression': {
'body': 1,
'parameters': 2,
},
'MemberExpression': 2,
'ObjectExpression': 1,
'SwitchCase': 1,
'ignoredNodes': [
'ConditionalExpression',
],
},
],
// 'jsx-quotes': 0,
'key-spacing': 2,
'keyword-spacing': 2,
Expand All @@ -225,8 +244,9 @@ module.exports = {
// 'max-params': 0,
// 'max-statements': 0,
// 'max-statements-per-line': 0,
// 'multiline-ternary': 0, // TODO(philipwalton): add a rule to enforce the
// operator appearing at the end of the line.
// TODO(philipwalton): add a rule to enforce the operator appearing
// at the end of the line.
// 'multiline-ternary': 0,
'new-cap': 2,
// 'new-parens': 0,
// 'newline-per-chained-call': 0,
Expand Down Expand Up @@ -297,10 +317,10 @@ module.exports = {
// http://eslint.org/docs/rules/#ecmascript-6
// ------------------------------------------
// 'arrow-body-style': 0,
'arrow-parens': [2, 'always'], // TODO(philipwalton): technically arrow
// parens are optional but recommended.
// ESLint doesn't support a *consistent*
// setting so "always" is used.
// TODO(philipwalton): technically arrow parens are optional but
// recommended. ESLint doesn't support a *consistent* setting so
// "always" is used.
'arrow-parens': [2, 'always'],
// 'arrow-spacing': 0,
'constructor-super': 2, // eslint:recommended
'generator-star-spacing': [2, 'after'],
Expand Down

0 comments on commit 1fdcfc2

Please sign in to comment.