1 | module.exports = {
|
2 | env: {
|
3 | browser: true,
|
4 | es6: true
|
5 | },
|
6 | parserOptions: {
|
7 | ecmaVersion: 6,
|
8 | sourceType: 'module'
|
9 | },
|
10 | plugins: ['lodash'],
|
11 | extends: ['eslint:recommended', 'plugin:lodash/canonical'],
|
12 | rules: {
|
13 | 'accessor-pairs': 'error',
|
14 | 'array-bracket-spacing': 'warn',
|
15 | 'arrow-spacing': 'warn',
|
16 | 'block-spacing': ['warn', 'never'],
|
17 | 'brace-style': ['warn', '1tbs', {allowSingleLine: true}],
|
18 | 'camelcase': 'error',
|
19 | 'comma-spacing': 'warn',
|
20 | 'comma-style': 'warn',
|
21 | 'computed-property-spacing': 'warn',
|
22 | 'curly': ['error', 'multi-line'],
|
23 | 'dot-location': ['warn', 'property'],
|
24 | 'dot-notation': 'warn',
|
25 | 'eol-last': 'warn',
|
26 | 'eqeqeq': 'error',
|
27 | 'func-call-spacing': 'warn',
|
28 | 'generator-star-spacing': 'warn',
|
29 | 'indent': ['warn', 2, {
|
30 | SwitchCase: 1,
|
31 | MemberExpression: 'off',
|
32 | FunctionDeclaration: {parameters: 'off'},
|
33 | FunctionExpression: {parameters: 'off'}
|
34 | }],
|
35 | 'key-spacing': ['warn', {mode: 'minimum'}],
|
36 | 'keyword-spacing': 'warn',
|
37 | 'linebreak-style': 'warn',
|
38 | 'lodash/chaining': ['error', 'implicit'],
|
39 | 'lodash/prefer-filter': 'off',
|
40 | 'lodash/prefer-immutable-method': 'off',
|
41 | 'lodash/prefer-invoke-map': 'off',
|
42 | 'lodash/prefer-lodash-method': ['error', {
|
43 | ignoreMethods: ['split', 'replace'],
|
44 | ignoreObjects: [/^\$/, /element/i, /table/i, '^completions$']
|
45 | }],
|
46 | 'max-len': ['warn', {code: 100, ignoreUrls: true, ignoreRegExpLiterals: true}],
|
47 | 'new-cap': 'error',
|
48 | 'new-parens': 'error',
|
49 | 'no-alert': 'error',
|
50 | 'no-array-constructor': 'error',
|
51 | 'no-bitwise': ['error', {allow: ['~']}],
|
52 | 'no-caller': 'error',
|
53 | 'no-console': 'off',
|
54 | 'no-constant-condition': ['error', {checkLoops: false}],
|
55 | 'no-duplicate-imports': 'error',
|
56 | 'no-else-return': 'error',
|
57 | 'no-empty-function': 'error',
|
58 | 'no-eval': 'error',
|
59 | 'no-extend-native': 'error',
|
60 | 'no-extra-bind': 'error',
|
61 | 'no-extra-label': 'error',
|
62 | 'no-floating-decimal': 'error',
|
63 | 'no-implicit-globals': 'error',
|
64 | 'no-implied-eval': 'error',
|
65 | 'no-invalid-this': 'error',
|
66 | 'no-iterator': 'error',
|
67 | 'no-lone-blocks': 'error',
|
68 | 'no-lonely-if': 'error',
|
69 | 'no-loop-func': 'error',
|
70 | 'no-multi-spaces': ['warn', {ignoreEOLComments: true}],
|
71 | 'no-multi-str': 'warn',
|
72 | 'no-multiple-empty-lines': 'warn',
|
73 | 'no-new': 'error',
|
74 | 'no-new-func': 'error',
|
75 | 'no-new-object': 'error',
|
76 | 'no-new-wrappers': 'error',
|
77 | 'no-octal-escape': 'error',
|
78 | 'no-proto': 'error',
|
79 | 'no-prototype-builtins': 'off',
|
80 | 'no-script-url': 'error',
|
81 | 'no-self-compare': 'error',
|
82 | 'no-sequences': 'error',
|
83 | 'no-shadow': 'error',
|
84 | 'no-shadow-restricted-names': 'error',
|
85 | 'no-tabs': 'warn',
|
86 | 'no-template-curly-in-string': 'error',
|
87 | 'no-throw-literal': 'error',
|
88 | 'no-trailing-spaces': 'warn',
|
89 | 'no-undef-init': 'error',
|
90 | 'no-unexpected-multiline': 'off',
|
91 | 'no-unmodified-loop-condition': 'error',
|
92 | 'no-unneeded-ternary': 'error',
|
93 | 'no-unused-expressions': 'error',
|
94 | 'no-unused-vars': ['error', {args: 'none'}],
|
95 | 'no-use-before-define': ['error', {functions: false}],
|
96 | 'no-useless-call': 'error',
|
97 | 'no-useless-computed-key': 'error',
|
98 | 'no-useless-concat': 'error',
|
99 | 'no-useless-constructor': 'error',
|
100 | 'no-useless-rename': 'error',
|
101 | 'no-useless-return': 'error',
|
102 | 'no-var': 'error',
|
103 | 'no-whitespace-before-property': 'warn',
|
104 | 'no-with': 'error',
|
105 | 'nonblock-statement-body-position': 'error',
|
106 | 'object-curly-spacing': 'warn',
|
107 | 'object-shorthand': 'error',
|
108 | 'operator-linebreak': ['warn', 'after'],
|
109 |
|
110 | 'prefer-const': 'error',
|
111 | 'prefer-numeric-literals': 'error',
|
112 | 'prefer-promise-reject-errors': 'error',
|
113 | 'quotes': ['error', 'single', {allowTemplateLiterals: true}],
|
114 | 'radix': 'error',
|
115 | 'rest-spread-spacing': 'warn',
|
116 | 'semi': 'error',
|
117 | 'semi-spacing': 'warn',
|
118 | 'semi-style': 'warn',
|
119 | 'space-before-blocks': 'warn',
|
120 | 'space-before-function-paren': ['warn', 'never'],
|
121 | 'space-in-parens': 'warn',
|
122 | 'space-infix-ops': 'warn',
|
123 | 'space-unary-ops': ['warn', {words: true, nonwords: false}],
|
124 | 'spaced-comment': 'warn',
|
125 | 'strict': ['error'],
|
126 | 'switch-colon-spacing': 'warn',
|
127 | 'template-curly-spacing': 'warn',
|
128 | 'template-tag-spacing': 'warn',
|
129 | 'unicode-bom': 'error',
|
130 | 'yoda': 'error',
|
131 | }
|
132 | };
|