test: enable linting for tests
[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
13 rules:
14   # Possible Errors
15   # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
16   ## check debugger sentence
17   no-debugger: 2
18   ## check duplicate arguments
19   no-dupe-args: 2
20   ## check duplicate object keys
21   no-dupe-keys: 2
22   ## check duplicate switch-case
23   no-duplicate-case: 2
24   ## disallow assignment of exceptional params
25   no-ex-assign: 2
26   ## disallow use of reserved words as keys like enum, class
27   no-reserved-keys: 2
28   ## disallow unreachable code
29   no-unreachable: 2
30   ## require valid typeof compared string like typeof foo === 'strnig'
31   valid-typeof: 2
32
33   # Best Practices
34   # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
35   ## require falls through comment on switch-case
36   no-fallthrough: 2
37
38   # Stylistic Issues
39   # list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
40   ## use single quote, we can use double quote when escape chars
41   quotes:
42     - 2
43     - "single"
44     - "avoid-escape"
45   ## 2 space indentation
46   indent:
47     - 2
48     - 2
49   ## add space after comma
50   ## set to 'warn' because of https://github.com/eslint/eslint/issues/2408
51   comma-spacing: 1
52   ## put semi-colon
53   semi: 2
54   ## require spaces operator like var sum = 1 + 1;
55   space-infix-ops: 2
56   ## require spaces return, throw, case
57   space-return-throw-case: 2
58   ## no space before function, eg. 'function()'
59   space-before-function-paren: [2, "never"]
60   ## require space before blocks, eg 'function() {'
61   space-before-blocks: [2, "always"]
62   ## require parens for Constructor
63   new-parens: 2
64   ## max 80 length
65   max-len:
66     - 2
67     - 80
68     - 2
69
70   # Strict Mode
71   # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
72   ## 'use strict' on top
73   strict:
74     - 2
75     - "global"
76
77 # Global scoped method and vars
78 globals:
79   DTRACE_HTTP_CLIENT_REQUEST: true
80   LTTNG_HTTP_CLIENT_REQUEST: true
81   COUNTER_HTTP_CLIENT_REQUEST: true
82   DTRACE_HTTP_CLIENT_RESPONSE: true
83   LTTNG_HTTP_CLIENT_RESPONSE: true
84   COUNTER_HTTP_CLIENT_RESPONSE: true
85   DTRACE_HTTP_SERVER_REQUEST: true
86   LTTNG_HTTP_SERVER_REQUEST: true
87   COUNTER_HTTP_SERVER_REQUEST: true
88   DTRACE_HTTP_SERVER_RESPONSE: true
89   LTTNG_HTTP_SERVER_RESPONSE: true
90   COUNTER_HTTP_SERVER_RESPONSE: true
91   DTRACE_NET_STREAM_END: true
92   LTTNG_NET_STREAM_END: true
93   COUNTER_NET_SERVER_CONNECTION_CLOSE: true
94   DTRACE_NET_SERVER_CONNECTION: true
95   LTTNG_NET_SERVER_CONNECTION: true
96   COUNTER_NET_SERVER_CONNECTION: true