tools: alphabetize eslint stylistic issues section
[platform/upstream/nodejs.git] / .eslintrc
1 env:
2   node: true
3
4 # enable ECMAScript features
5 ecmaFeatures:
6   arrowFunctions: true
7   binaryLiterals: true
8   blockBindings: true
9   classes: true
10   forOf: true
11   generators: true
12   objectLiteralShorthandMethods: true
13   objectLiteralShorthandProperties: true
14   octalLiterals: true
15   templateStrings: true
16
17 rules:
18   # Possible Errors
19   # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
20   ## disallow control characters in regular expressions
21   no-control-regex: 2
22   ## check debugger sentence
23   no-debugger: 2
24   ## check duplicate arguments
25   no-dupe-args: 2
26   ## check duplicate object keys
27   no-dupe-keys: 2
28   ## check duplicate switch-case
29   no-duplicate-case: 2
30   ## disallow the use of empty character classes in regular expressions
31   no-empty-character-class: 2
32   ## disallow assignment of exceptional params
33   no-ex-assign: 2
34   ## disallow extra boolean casts
35   no-extra-boolean-cast : 2
36   ## disallow superfluous semicolons
37   no-extra-semi: 2
38   ## validate regular expressions
39   no-invalid-regexp: 2
40   ## forbid weird whitespace characters
41   no-irregular-whitespace: 2
42   ## avoid unexpected multiline expressions
43   no-unexpected-multiline: 2
44   ## disallow unreachable code
45   no-unreachable: 2
46   ## require valid typeof compared string like typeof foo === 'strnig'
47   valid-typeof: 2
48
49   # Best Practices
50   # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
51   ## require falls through comment on switch-case
52   no-fallthrough: 2
53   ## disallow declaring the same variable more than once
54   no-redeclare: 2
55
56   # Stylistic Issues
57   # list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
58   ## add space after comma
59   comma-spacing: 2
60   ## require newline at end of files
61   eol-last: 2
62   ## 2 space indentation
63   indent: [2, 2, {SwitchCase: 1}]
64   ## max 80 length
65   max-len: [2, 80, 2]
66   ## require parens for Constructor
67   new-parens: 2
68   ## max 2 consecutive empty lines
69   no-multiple-empty-lines: [2, {max: 2}]
70   ## no trailing spaces
71   no-trailing-spaces: 2
72   ## use single quote, we can use double quote when escape chars
73   quotes: [2, "single", "avoid-escape"]
74   ## put semi-colon
75   semi: 2
76   ## require space after keywords, eg 'for (..)'
77   space-after-keywords: 2
78   ## require space before blocks, eg 'function() {'
79   space-before-blocks: [2, "always"]
80   ## no space before function, eg. 'function()'
81   space-before-function-paren: [2, "never"]
82   ## no leading/trailing spaces in parens
83   space-in-parens: [2, "never"]
84   ## require spaces operator like var sum = 1 + 1;
85   space-infix-ops: 2
86   ## require spaces return, throw, case
87   space-return-throw-case: 2
88   ## no spaces with non-word unary operators, require for word unary operators
89   space-unary-ops: 2
90
91   # ECMAScript 6
92   # list: http://eslint.org/docs/rules/#ecmascript-6
93   ## Suggest using 'const' wherever possible
94   prefer-const: 2
95   ## Enforce parens around arrow function arguments
96   arrow-parens: [2, "always"]
97   ## Require a space on each side of arrow operator
98   arrow-spacing: [2, {"before": true, "after": true}]
99   ## Prevent using => in a condition where <= is intended
100   no-arrow-condition: 2
101
102   # Strict Mode
103   # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
104   ## 'use strict' on top
105   strict: [2, "global"]
106
107   # Variables
108   # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables
109   ## disallow use of undefined variables (globals)
110   no-undef: 2
111   ## disallow declaration of variables that are not used in the code
112   no-unused-vars: [2, {"args": "none"}]
113
114   # Custom rules in tools/eslint-rules
115   require-buffer: 2
116   new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"]
117
118
119 # Global scoped method and vars
120 globals:
121   DTRACE_HTTP_CLIENT_REQUEST           : false
122   LTTNG_HTTP_CLIENT_REQUEST            : false
123   COUNTER_HTTP_CLIENT_REQUEST          : false
124   DTRACE_HTTP_CLIENT_RESPONSE          : false
125   LTTNG_HTTP_CLIENT_RESPONSE           : false
126   COUNTER_HTTP_CLIENT_RESPONSE         : false
127   DTRACE_HTTP_SERVER_REQUEST           : false
128   LTTNG_HTTP_SERVER_REQUEST            : false
129   COUNTER_HTTP_SERVER_REQUEST          : false
130   DTRACE_HTTP_SERVER_RESPONSE          : false
131   LTTNG_HTTP_SERVER_RESPONSE           : false
132   COUNTER_HTTP_SERVER_RESPONSE         : false
133   DTRACE_NET_STREAM_END                : false
134   LTTNG_NET_STREAM_END                 : false
135   COUNTER_NET_SERVER_CONNECTION_CLOSE  : false
136   DTRACE_NET_SERVER_CONNECTION         : false
137   LTTNG_NET_SERVER_CONNECTION          : false
138   COUNTER_NET_SERVER_CONNECTION        : false