Skip to content

Commit

Permalink
tools: enforce consistent spacing inside braces
Browse files Browse the repository at this point in the history
PR-URL: #14162
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
sebdeckers authored and refack committed Jul 21, 2017
1 parent bb29405 commit 6add5b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test/fixtures
test/disabled
test/tmp*/
tools/eslint
tools/icu
node_modules
benchmark/tmp/
doc/**/*.js
7 changes: 4 additions & 3 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,17 @@ rules:
}]
no-tabs: error
no-trailing-spaces: error
object-curly-spacing: [error, always]
one-var-declaration-per-line: error
operator-linebreak: [error, after]
quotes: [error, single, avoid-escape]
semi: error
semi-spacing: error
space-before-blocks: [error, always]
space-before-function-paren: [error, {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
anonymous: never,
named: never,
asyncArrow: always
}]
space-in-parens: [error, never]
space-infix-ops: error
Expand Down
2 changes: 0 additions & 2 deletions doc/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## Docs-specific linter rules

rules:
object-curly-spacing: [error, always]

# ease some restrictions in doc examples
no-restricted-properties: off
no-undef: off
Expand Down

3 comments on commit 6add5b3

@refack
Copy link
Contributor

@refack refack commented on 6add5b3 Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @nodejs/collaborators the "house rule" is now an eslint rule — spaces inside braces, i.e. { a:1, b:2 }

@sam-github
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about array literals, are they like object literals, or the opposite? eslint doesn't seem to enforce anything, if we have a vote, I'd vote for consistency.

@vsemozhetbyt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refs: One of the popular style guides makes a difference between array-bracket-spacing and object-curly-spacing, but it seems they do not explain this difference.

Please sign in to comment.