-
-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy patheslint.config.js
More file actions
144 lines (135 loc) · 4.49 KB
/
eslint.config.js
File metadata and controls
144 lines (135 loc) · 4.49 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
const reactNativeConfig = require('@react-native/eslint-config/flat');
const importPlugin = require('eslint-plugin-import');
const prettierPlugin = require('eslint-plugin-prettier');
module.exports = [
// Ignore patterns (must be first for ESLint 9 global ignores)
{
ignores: [
'node_modules/**',
'zeus_modules/**',
'android/**',
'ios/**',
'proto/**',
'shim.js',
'babel.config.js',
'metro.config.js',
'react-native.config.js',
'index.js'
]
},
// Base React Native flat config (includes prettier conflict resolution)
...reactNativeConfig,
// Disable ft-flow rules globally (Zeus uses TypeScript, not Flow;
// eslint-plugin-ft-flow@2.x is incompatible with ESLint 9)
{
files: ['**/*.js'],
rules: {
'ft-flow/define-flow-type': 'off',
'ft-flow/use-flow-type': 'off',
'ft-flow/boolean-style': 'off',
'ft-flow/no-dupe-keys': 'off',
'ft-flow/no-primitive-constructor-types': 'off',
'ft-flow/no-types-missing-file-annotation': 'off',
'ft-flow/no-unused-expressions': 'off',
'ft-flow/no-weak-types': 'off',
'ft-flow/require-valid-file-annotation': 'off'
}
},
// Import plugin for all files
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
plugins: {
import: importPlugin
},
settings: {
'import/resolver': {
typescript: true,
node: true
}
},
rules: {
'import/default': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': ['error', { commonjs: true, amd: true }]
}
},
// TypeScript-specific overrides
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: __dirname
},
globals: {
JSX: 'readonly',
Buffer: 'readonly'
}
},
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrors: 'none'
}
],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
},
// Global rule overrides for all files
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
JSX: 'readonly',
Buffer: 'readonly'
}
},
rules: {
'comma-dangle': 'off',
curly: 'off',
camelcase: 'off',
'no-case-declarations': 'off',
'no-control-regex': 'off',
'no-undef': 'error',
'no-unused-vars': 'off',
'object-shorthand': ['error', 'always'],
'prefer-spread': 'off',
'react/no-string-refs': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-native/no-inline-styles': 'off',
'react/no-unstable-nested-components': 'off',
'react/self-closing-comp': 'off',
'react-hooks/exhaustive-deps': 'off',
// TODO re-evaluate
'dot-notation': 'off',
eqeqeq: 'off',
'no-bitwise': 'off',
'no-const-assign': 'off',
'no-div-regex': 'off',
'no-lone-blocks': 'off',
'no-void': 'off',
radix: 'off',
semi: 'off',
quotes: 'off',
'prettier/prettier': ['error', { endOfLine: 'auto' }]
},
plugins: {
prettier: prettierPlugin
}
}
];