UNPKG

5.64 kBJavaScriptView Raw
1'use strict';
2
3module.exports = {
4 root: true,
5 'parser': 'espree',
6 'parserOptions': {
7 'ecmaVersion': 9,
8 'sourceType': 'script',
9 },
10 env: {
11 node: true,
12 es6: true,
13 jest: true,
14 },
15 rules: {
16 'accessor-pairs': 'error',
17 'array-bracket-newline': [ 'error', { multiline: true } ],
18 'array-bracket-spacing': [ 'error', 'always' ],
19 'array-callback-return': 'error',
20 'arrow-body-style': [ 'error', 'as-needed' ],
21 'arrow-spacing': 'error',
22 'block-spacing': [ 'error', 'always' ],
23 'brace-style': [ 'error', '1tbs', { allowSingleLine: true } ],
24 'callback-return': 'error',
25 camelcase: [ 'error', { properties: 'always' } ],
26 'comma-dangle': [ 'error', 'always-multiline' ],
27 'comma-spacing': 'error',
28 'comma-style': [ 'error', 'last' ],
29 'consistent-return': 'error',
30 'constructor-super': 'error',
31 'curly': 'error',
32 'dot-location': [ 'error', 'object' ],
33 'dot-notation': 'error',
34 'eol-last': 'error',
35 eqeqeq: [ 'error', 'always' ],
36 'handle-callback-err': 'error',
37 indent: [ 'error', 2, { SwitchCase: 1 } ],
38 'key-spacing': [
39 'error', {
40 beforeColon: false,
41 afterColon: true,
42 },
43 ],
44 'keyword-spacing': 'error',
45 'max-params': [ 'error', 5 ],
46 'new-cap': 'error',
47 'newline-per-chained-call': 'error',
48 'no-caller': 'error',
49 'no-case-declarations': 'error',
50 'no-class-assign': 'error',
51 'no-cond-assign': [ 'error', 'except-parens' ],
52 'no-confusing-arrow': 'error',
53 'no-const-assign': 'error',
54 'no-constant-condition': 'error',
55 'no-delete-var': 'error',
56 'no-dupe-args': 'error',
57 'no-dupe-class-members': 'error',
58 'no-dupe-keys': 'error',
59 'no-else-return': 'error',
60 'no-empty': [ 'error', { allowEmptyCatch: true } ],
61 'no-empty-character-class': 'error',
62 'no-empty-pattern': 'error',
63 'no-eq-null': 'error',
64 'no-eval': 'error',
65 'no-ex-assign': 'error',
66 'no-extra-bind': 'error',
67 'no-extra-boolean-cast': 'error',
68 'no-extra-parens': 'error',
69 'no-extra-semi': 'error',
70 'no-fallthrough': 'error',
71 'no-floating-decimal': 'error',
72 'no-implicit-coercion': 'error',
73 'no-implicit-globals': 'error',
74 'no-implied-eval': 'error',
75 'no-invalid-regexp': 'error',
76 'no-invalid-this': 'error',
77 'no-irregular-whitespace': 'error',
78 'no-labels': 'error',
79 'no-lone-blocks': 'error',
80 'no-lonely-if': 'error',
81 'no-mixed-requires': 'error',
82 'no-multi-spaces': 'error',
83 'no-multi-str': 'error',
84 'no-multiple-empty-lines': [ 'error', { max: 1 } ],
85 'no-native-reassign': [ 'error', { exceptions: [ 'Object' ] } ],
86 'no-negated-in-lhs': 'error',
87 'no-new': 'error',
88 'no-new-func': 'error',
89 'no-new-require': 'error',
90 'no-new-symbol': 'error',
91 'no-new-wrappers': 'error',
92 'no-obj-calls': 'error',
93 'no-octal-escape': 'error',
94 'no-path-concat': 'error',
95 'no-proto': 'error',
96 'no-redeclare': 'error',
97 'no-regex-spaces': 'error',
98 'no-return-assign': 'error',
99 'no-self-assign': 'error',
100 'no-self-compare': 'error',
101 'no-sequences': 'error',
102 'no-shadow': [ 'error', { allow: [ 'body', 'error', 'reject', 'resolve', 'response', 'result' ] } ],
103 'no-shadow-restricted-names': 'error',
104 'no-spaced-func': 'error',
105 'no-sparse-arrays': 'error',
106 'no-this-before-super': 'error',
107 'no-throw-literal': 'error',
108 'no-trailing-spaces': 'error',
109 'no-undef': 'error',
110 'no-unexpected-multiline': 'error',
111 'no-unmodified-loop-condition': 'error',
112 'no-unneeded-ternary': 'error',
113 'no-unreachable': 'error',
114 'no-unused-expressions': 'error',
115 'no-unused-vars': 'error',
116 'no-use-before-define': [ 'error', 'nofunc' ],
117 'no-useless-call': 'error',
118 'no-useless-concat': 'error',
119 'no-useless-constructor': 'error',
120 'no-useless-escape': 'error',
121 'no-useless-return': 'error',
122 'no-var': 'error',
123 'no-void': 'error',
124 'no-warning-comments': [
125 'error', {
126 terms: [ 'todo', 'fixme', 'hack' ],
127 location: 'anywhere',
128 },
129 ],
130 'no-with': 'error',
131 'object-curly-newline': [
132 'error', {
133 'ObjectExpression': {
134 multiline: true,
135 minProperties: 2,
136 },
137 'ObjectPattern': { minProperties: 3 },
138 'ImportDeclaration': { minProperties: 3 },
139 'ExportDeclaration': {
140 multiline: true,
141 minProperties: 3,
142 },
143 },
144 ],
145 'object-curly-spacing': [ 'error', 'always' ],
146 'object-property-newline': 'error',
147 'object-shorthand': 'error',
148 'one-var': [ 'error', 'never' ],
149 'one-var-declaration-per-line': 'error',
150 'operator-linebreak': [ 'error', 'after' ],
151 'padded-blocks': [ 'error', 'never' ],
152 'prefer-arrow-callback': 'error',
153 'prefer-const': 'error',
154 'prefer-promise-reject-errors': 'error',
155 'prefer-rest-params': 'error',
156 'prefer-spread': 'error',
157 'prefer-template': 'error',
158 quotes: [ 'error', 'single', { avoidEscape: true } ],
159 radix: [ 'error', 'always' ],
160 'require-yield': 'error',
161 semi: [ 'error', 'always' ],
162 'spaced-comment': [ 'error', 'always', { exceptions: [ '/' ] } ],
163 'space-before-blocks': 'error',
164 'space-before-function-paren': [
165 'error', {
166 anonymous: 'ignore',
167 named: 'always',
168 },
169 ],
170 'space-infix-ops': 'error',
171 strict: 'error',
172 'template-curly-spacing': [ 'error', 'always' ],
173 'use-isnan': 'error',
174 'valid-typeof': 'error',
175 'yield-star-spacing': [ 'error', 'before' ],
176 yoda: 'error',
177 },
178};