-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (63 loc) · 1.59 KB
/
eslint.config.mjs
File metadata and controls
66 lines (63 loc) · 1.59 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
import tsEslint from 'typescript-eslint';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import reanimated from 'eslint-plugin-reanimated';
import eslintConfig from '../../eslint.config.mjs';
/**
* @type {(
* | import('typescript-eslint').ConfigWithExtends
* | import('eslint').Linter.Config
* )[]}
*/
const config = tsEslint.config(
...eslintConfig,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: [
'./tsconfig.json',
'./tsconfig.web.json',
'../../tsconfig.json',
],
},
},
plugins: {
reanimated,
'simple-import-sort': simpleImportSort,
},
rules: {
'reanimated/use-worklets-error': 'error',
'reanimated/use-global-this': 'error',
'no-bitwise': 'error',
// TODO: Use this rule in Reanimated (globally in the repo) too
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['*.native', '*.ios', '*.android', '*.web'],
message:
"Don't import with platform specifier, use extensionless imports.",
},
],
},
],
},
},
{
rules: {
strict: ['error', 'global'],
'@typescript-eslint/no-explicit-any': 'error',
},
files: ['src/**/*.tsx', 'src/**/*.ts'],
ignores: ['__tests__', '__mocks__'],
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
}
);
export default config;