-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
.eslintrc.cjs
131 lines (131 loc) · 3.2 KB
/
.eslintrc.cjs
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
120
121
122
123
124
125
126
127
128
129
130
131
module.exports = {
env: {
es2021: true,
// jest: true,
browser: true,
node: true,
},
parser: '@typescript-eslint/parser',
extends: [
'standard',
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
"plugin:@typescript-eslint/eslint-recommended",
'plugin:@typescript-eslint/recommended',
'plugin:json/recommended-legacy',
'plugin:jest/recommended',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
project: './tsconfig.json',
},
},
{
files: ["tests/**/*"],
plugins: ["jest"],
env: {
'jest/globals': true,
},
},
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'@stylistic',
'react',
'react-hooks',
],
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 0,
'@stylistic/no-explicit-any': 'off',
'react/no-unknown-property': 0,
'indent': [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 'first',
ignoredNodes: ['TemplateLiteral'],
},
],
'template-curly-spacing': 'off',
'linebreak-style': ['off', 'unix'],
'quotes': ['error', 'single'],
'jsx-quotes': ['error', 'prefer-single'],
'@stylistic/semi': ['error', 'never'],
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none', // No semicolon for multiline
requireLast: true,
},
singleline: {
delimiter: 'comma', // Use comma for single line
requireLast: false,
},
},
],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'never',
functions: 'never',
},
],
'arrow-parens': ['error', 'as-needed'],
'no-func-assign': 'off',
'no-class-assign': 'off',
'no-useless-escape': 'off',
'curly': [2, 'multi', 'consistent'],
'react/prop-types': 'off', // TODO: TURN ON AND FIX ALL WARNINGS
'react/display-name': 'off',
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks:
'(useAnimatedStyle|useSharedValue|useAnimatedGestureHandler|useAnimatedScrollHandler|useAnimatedProps|useDerivedValue|useAnimatedRef|useAnimatedReact|useAnimatedReaction)',
// useAnimatedReaction
// USE RULE FUNC/FUNC/DEPS
},
],
'no-unused-vars': ['error'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'nonblock-statement-body-position': ['error', 'below'],
'@stylistic/jsx-closing-bracket-location': ['error', 'line-aligned'],
'no-unreachable': 'error',
},
globals: {
describe: 'readonly',
test: 'readonly',
jest: 'readonly',
expect: 'readonly',
fetch: 'readonly',
navigator: 'readonly',
__DEV__: 'readonly',
XMLHttpRequest: 'readonly',
FormData: 'readonly',
React$Element: 'readonly',
requestAnimationFrame: 'readonly',
},
}