Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-02-03 23:27:40 +0300
committerJames M Snell <jasnell@gmail.com>2016-02-04 21:56:17 +0300
commit7406cd3a59302d50420e3c6c12359ac20094ad24 (patch)
tree66d64a0dfc6b0a9ff83656870c8fe71ef5099fb3 /.eslintrc
parentc714b2e21cce7486c1c921aff492c45f39a40d27 (diff)
tools: lint for spacing around unary operators
Enable `space-unary-ops` in `.eslintrc`. This prohibits things like: i ++ // use `i++` instead typeof(foo) // use `typeof foo` or `typeof (foo)` instead Ref: https://github.com/nodejs/node/pull/4772#discussion_r51732299 PR-URL: https://github.com/nodejs/node/pull/5063 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.eslintrc')
-rw-r--r--.eslintrc2
1 files changed, 2 insertions, 0 deletions
diff --git a/.eslintrc b/.eslintrc
index 5b95af8045f..6aec251478c 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -83,6 +83,8 @@ rules:
space-after-keywords: 2
## no leading/trailing spaces in parens
space-in-parens: [2, "never"]
+ ## no spaces with non-word unary operators, require for word unary operators
+ space-unary-ops: 2
# ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6