forked from lnreader/lnreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (53 loc) · 1.51 KB
/
Copy patheslint.config.js
File metadata and controls
62 lines (53 loc) · 1.51 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
const { defineConfig, globalIgnores } = require('eslint/config');
const expoConfig = require('eslint-config-expo/flat');
const { FlatCompat } = require('@eslint/eslintrc');
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const testFiles = [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
];
module.exports = defineConfig([
globalIgnores([
'android/**',
'ios/**',
'node_modules/**',
'.expo/**',
'dist/**',
'coverage/**',
]),
expoConfig,
...compat
.extends('plugin:testing-library/react', 'plugin:jest/recommended')
.map(config => ({
...config,
files: testFiles,
})),
{
files: ['**/*.{js,jsx,ts,tsx}'],
rules: {
'no-shadow': 'off',
'no-undef': 'off',
'no-console': 'error',
'@typescript-eslint/no-shadow': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/static-components': 'warn',
'react-hooks/purity': 'warn',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/refs': 'warn',
'react-hooks/immutability': 'warn',
'react/no-children-prop': 'warn',
'react/display-name': 'off',
curly: ['error', 'multi-line', 'consistent'],
'no-useless-return': 'error',
'block-scoped-var': 'error',
'no-var': 'error',
'prefer-const': 'error',
'no-dupe-else-if': 'error',
'no-duplicate-imports': 'error',
'@react-native/no-deep-imports': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},
]);