forked from yearn/yWorld
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
106 lines (104 loc) · 4.16 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
module.exports = {
'env': {
'node': true,
'browser': true,
'es2021': true
},
'extends': [
'eslint:recommended',
'plugin:import/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:tailwindcss/recommended',
'plugin:@typescript-eslint/recommended'
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'ecmaVersion': 12,
'sourceType': 'module',
'project': ['./tsconfig.json']
},
'plugins': [
'@typescript-eslint',
'react',
'tailwindcss'
],
'settings': {
'react': {
'version': 'detect'
},
'import/resolver': {
'typescript': {}
}
},
'rules': {
'indent': [2, 'tab'],
'no-mixed-spaces-and-tabs': 2,
'react/prop-types': 0,
'no-async-promise-executor': 0,
'import/no-unresolved': 0, //Issue with package exports
'quotes': [2, 'single', {'avoidEscape': true}],
'object-curly-spacing': [2, 'never'],
'array-bracket-spacing': [2, 'never'],
'react/jsx-curly-brace-presence': ['error', {'props': 'always', 'children': 'always'}],
'semi': 'error',
'tailwindcss/no-custom-classname': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/array-type': ['error', {'default': 'array'}],
'@typescript-eslint/consistent-type-assertions': ['error', {'assertionStyle': 'as', 'objectLiteralTypeAssertions': 'never'}],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'],
'@typescript-eslint/explicit-function-return-type': ['error', {
'allowExpressions': false,
'allowTypedFunctionExpressions': false,
'allowHigherOrderFunctions': false,
'allowDirectConstAssertionInArrowFunctions': false,
'allowConciseArrowFunctionExpressionsStartingWithVoid': false,
'allowedNames': []
}],
'@typescript-eslint/naming-convention': ['error',
{'selector': 'default', 'format': ['camelCase']},
{'selector': 'function', 'format': ['camelCase', 'PascalCase']},
{'selector': 'variableLike', 'format': ['camelCase', 'PascalCase', 'UPPER_CASE'], 'leadingUnderscore': 'allow'},
{'selector': 'variable', 'types': ['boolean'], 'format': ['PascalCase'], 'prefix': ['is', 'should', 'has', 'can', 'did', 'will']},
{'selector': 'default', 'format': null, 'filter': {'regex': '^(0-9)$', 'match': false}},
{
'selector': 'variableLike',
'filter': {'regex': '^(set)', 'match': true},
'format': ['camelCase'],
'prefix': ['set_']
},
{'selector': 'variableLike', 'format': ['PascalCase'], 'filter': {'regex': '(Context)$|(ContextApp)$|^Component$', 'match': true}},
{'selector': ['typeParameter', 'typeAlias'], 'format': ['PascalCase'], 'prefix': ['T']},
{'selector': 'interface', 'format': ['PascalCase'], 'prefix': ['I']},
{'selector': ['default', 'variableLike', 'parameter'], 'format': null, 'filter': {'regex': '^(__html|_css)$', 'match': true}}
],
'@typescript-eslint/no-misused-promises': ['error', {'checksConditionals': true, 'checksVoidReturn': false}],
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': ['error', {
'allowComparingNullableBooleansToTrue': false,
'allowComparingNullableBooleansToFalse': false
}],
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/type-annotation-spacing': ['error', {'before': true, 'after': true, 'overrides': {'colon': {'before': false, 'after': true}}}],
'brace-style': 'off',
'@typescript-eslint/brace-style': ['error', '1tbs'],
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error'],
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': ['error'],
'dot-notation': 'off',
'@typescript-eslint/dot-notation': ['error']
}
};