UNPKG

4.38 kBJavaScriptView Raw
1module.exports = {
2 env: {
3 browser: true
4 },
5 parserOptions: {
6 ecmaVersion: 6,
7 sourceType: 'module'
8 },
9 plugins: ['lodash'],
10 extends: ['eslint:recommended', 'plugin:lodash/v3'],
11 globals: {
12 Promise: false,
13 },
14 rules: {
15 'accessor-pairs': 'error',
16 'array-bracket-spacing': 'warn',
17 'arrow-spacing': 'warn',
18 'block-spacing': ['warn', 'never'],
19 'brace-style': ['warn', '1tbs', {allowSingleLine: true}],
20 'camelcase': 'error',
21 'comma-spacing': 'warn',
22 'comma-style': 'warn',
23 'computed-property-spacing': 'warn',
24 'curly': ['error', 'multi-line'],
25 'dot-location': ['warn', 'property'],
26 'dot-notation': 'warn',
27 'eol-last': 'warn',
28 'eqeqeq': 'error',
29 'func-call-spacing': 'warn',
30 'generator-star-spacing': 'warn',
31 'indent': ['warn', 2, {
32 SwitchCase: 1,
33 MemberExpression: 'off',
34 FunctionDeclaration: {parameters: 'off'},
35 FunctionExpression: {parameters: 'off'}
36 }],
37 'key-spacing': ['warn', {mode: 'minimum'}],
38 'keyword-spacing': 'warn',
39 'linebreak-style': 'warn',
40 'lodash/matches-prop-shorthand': 'off',
41 'lodash/no-commit': 'off',
42 'lodash/prefer-filter': 'off',
43 'lodash/prefer-lodash-method': ['error', {
44 ignoreMethods: ['split'], ignoreObjects: [/^\$/, /element/i, /table/i, '^completions$']
45 }],
46 'lodash/prefer-map': 'off',
47 'max-len': ['warn', {code: 100, ignoreUrls: true, ignoreRegExpLiterals: true}],
48 'new-cap': 'error',
49 'new-parens': 'error',
50 'no-alert': 'error',
51 'no-array-constructor': 'error',
52 'no-bitwise': ['error', {allow: ['~']}],
53 'no-caller': 'error',
54 'no-console': 'off',
55 'no-constant-condition': ['error', {checkLoops: false}],
56 'no-duplicate-imports': 'error',
57 'no-else-return': 'error',
58 'no-empty-function': 'error',
59 'no-eval': 'error',
60 'no-extend-native': 'error',
61 'no-extra-bind': 'error',
62 'no-extra-label': 'error',
63 'no-floating-decimal': 'error',
64 'no-implicit-globals': 'error',
65 'no-implied-eval': 'error',
66 'no-invalid-this': 'error',
67 'no-iterator': 'error',
68 'no-lone-blocks': 'error',
69 'no-lonely-if': 'error',
70 'no-loop-func': 'error',
71 'no-multi-spaces': ['warn', {ignoreEOLComments: true}],
72 'no-multi-str': 'warn',
73 'no-multiple-empty-lines': 'warn',
74 'no-new': 'error',
75 'no-new-func': 'error',
76 'no-new-object': 'error',
77 'no-new-wrappers': 'error',
78 'no-octal-escape': 'error',
79 'no-proto': 'error',
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 // 'prefer-arrow-callback': 'error', // turned off due to Angular
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};