This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
119 lines (119 loc) · 3.05 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
module.exports = {
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
env: {
browser: true,
},
plugins: ['svelte3', 'prettier'],
extends: ['eslint:recommended', 'prettier'],
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3',
},
],
rules: {
// Errors
'no-console': 'warn',
// Best practices
'array-callback-return': ['error', { allowImplicit: true }],
'block-scoped-var': 'error',
'consistent-return': 'error',
curly: ['error', 'multi-line'],
'default-param-last': 'error',
'dot-notation': ['error', { allowKeywords: true }],
eqeqeq: ['error', 'always', { null: 'ignore' }],
'guard-for-in': 'error',
'max-classes-per-file': ['error', 1],
'no-alert': 'error',
'no-caller': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-implicit-coercion': [
'off',
{
boolean: false,
number: true,
string: true,
allow: [],
},
],
'no-iterator': 'error',
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: [
'acc', // for reduce accumulators
'accumulator', // for reduce accumulators
'e', // for e.returnvalue
'ctx', // for Koa routing
'context', // for Koa routing
'req', // for Express requests
'request', // for Express requests
'res', // for Express responses
'response', // for Express responses
'$scope', // for Angular 1 scopes
'staticContext', // for ReactRouter context
],
},
],
'no-proto': 'error',
'no-redeclare': 'error',
'no-return-assign': ['error', 'always'],
'no-return-await': 'error',
'no-script-url': 'error',
'no-self-assign': [
'error',
{
props: true,
},
],
'no-self-compare': 'error',
'no-sequences': 'error',
'no-unused-expressions': [
'error',
{
allowShortCircuit: false,
allowTernary: false,
allowTaggedTemplates: false,
},
],
'no-useless-concat': 'error',
'no-useless-return': 'error',
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
'vars-on-top': 'error',
// Variables:
'no-label-var': 'error',
'no-shadow': 'off',
'no-shadow-restricted-names': 'error',
'no-undef-init': 'error',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'no-redeclare': 'off',
// Style
semi: ['error', 'always'],
// ES6
'no-var': 'error',
},
ignorePatterns: [
'node_modules/*',
'dist/*',
'types',
'.prettierrc.js',
'.eslintrc.js',
'tailwind.config.js',
],
};