tools: enable whitespace related rules in eslint
[platform/upstream/nodejs.git] / .eslintrc
1 env:
2   node: true
3
4 # enable ECMAScript features
5 ecmaFeatures:
6   blockBindings: true
7   templateStrings: true
8   octalLiterals: true
9   binaryLiterals: true
10   generators: true
11   forOf: true
12   objectLiteralShorthandProperties: true
13
14 rules:
15   # Possible Errors
16   # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
17   ## check debugger sentence
18   no-debugger: 2
19   ## check duplicate arguments
20   no-dupe-args: 2
21   ## check duplicate object keys
22   no-dupe-keys: 2
23   ## check duplicate switch-case
24   no-duplicate-case: 2
25   ## disallow assignment of exceptional params
26   no-ex-assign: 2
27   ## disallow use of reserved words as keys like enum, class
28   no-reserved-keys: 2
29   ## disallow unreachable code
30   no-unreachable: 2
31   ## require valid typeof compared string like typeof foo === 'strnig'
32   valid-typeof: 2
33
34   # Best Practices
35   # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
36   ## require falls through comment on switch-case
37   no-fallthrough: 2
38
39   # Stylistic Issues
40   # list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
41   ## use single quote, we can use double quote when escape chars
42   quotes: [2, "single", "avoid-escape"]
43   ## 2 space indentation
44   indent: [2, 2]
45   ## add space after comma
46   ## set to 'warn' because of https://github.com/eslint/eslint/issues/2408
47   comma-spacing: 1
48   ## put semi-colon
49   semi: 2
50   ## require spaces operator like var sum = 1 + 1;
51   space-infix-ops: 2
52   ## require spaces return, throw, case
53   space-return-throw-case: 2
54   ## no space before function, eg. 'function()'
55   space-before-function-paren: [2, "never"]
56   ## require space before blocks, eg 'function() {'
57   space-before-blocks: [2, "always"]
58   ## require parens for Constructor
59   new-parens: 2
60   ## max 80 length
61   max-len: [2, 80, 2]
62   ## max 2 consecutive empty lines
63   no-multiple-empty-lines: [2, {max: 2}]
64   ## require newline at end of files
65   eol-last: 2
66   ## no trailing spaces
67   no-trailing-spaces: 2
68
69   # Strict Mode
70   # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
71   ## 'use strict' on top
72   strict: [2, "global"]
73
74   # Variables
75   # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables
76   ## disallow use of undefined variables (globals)
77   no-undef: 2
78
79   # Custom rules in tools/eslint-rules
80   require-buffer: 2
81
82 # Global scoped method and vars
83 globals:
84   DTRACE_HTTP_CLIENT_REQUEST           : false
85   LTTNG_HTTP_CLIENT_REQUEST            : false
86   COUNTER_HTTP_CLIENT_REQUEST          : false
87   DTRACE_HTTP_CLIENT_RESPONSE          : false
88   LTTNG_HTTP_CLIENT_RESPONSE           : false
89   COUNTER_HTTP_CLIENT_RESPONSE         : false
90   DTRACE_HTTP_SERVER_REQUEST           : false
91   LTTNG_HTTP_SERVER_REQUEST            : false
92   COUNTER_HTTP_SERVER_REQUEST          : false
93   DTRACE_HTTP_SERVER_RESPONSE          : false
94   LTTNG_HTTP_SERVER_RESPONSE           : false
95   COUNTER_HTTP_SERVER_RESPONSE         : false
96   DTRACE_NET_STREAM_END                : false
97   LTTNG_NET_STREAM_END                 : false
98   COUNTER_NET_SERVER_CONNECTION_CLOSE  : false
99   DTRACE_NET_SERVER_CONNECTION         : false
100   LTTNG_NET_SERVER_CONNECTION          : false
101   COUNTER_NET_SERVER_CONNECTION        : false
102   escape                               : false
103   unescape                             : false