forked from openwallet-foundation/bifold-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
91 lines (90 loc) · 2.36 KB
/
eslint.config.mjs
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
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactPlugin from 'eslint-plugin-react'
import importPlugin from 'eslint-plugin-import';
import reactHooks from 'eslint-plugin-react-hooks';
import jestPlugin from 'eslint-plugin-jest'
export default [
{
settings: {
"react": {
"version": "detect"
}
}
},
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
import: importPlugin,
},
},
{
plugins: {
'react-hooks': reactHooks,
},
},
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
...reactPlugin.configs.flat.recommended,
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions,
globals: {
...globals.node,
},
},
rules: {
...reactHooks.configs.recommended.rules,
...reactPlugin.configs.flat.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'error',
},
},
{
ignores: [
'commitlint.config.js',
'eslint.config.mjs',
'.eslintrc-common.js',
'**/.eslintrc.js',
'scripts/make-blocks.js',
'scripts/get-next-bump.ts',
'**/jest.config.js',
'**/metro.config.js',
'.yarn/',
'packages/verifier/build/',
'packages/oca/build/',
'packages/remote-logs/build/',
'packages/react-native-attestation/build/',
'packages/legacy/core/lib/',
],
},
{
files: ['**/*.test.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}', '**/__mocks__/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'], // Adjust the pattern to match your test files
plugins: {
jest: jestPlugin,
},
languageOptions: {
globals: {
'jest/globals': true,
},
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
},
{
files: ['packages/legacy/core/**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
}
},
]