-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
42 lines (42 loc) · 1.06 KB
/
.eslintrc.js
File metadata and controls
42 lines (42 loc) · 1.06 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
module.exports = {
root: true,
extends: [
'@react-native',
'plugin:jest/recommended',
'plugin:@tanstack/query/recommended',
],
rules: {
// don't allow nested ternaries
'no-nested-ternary': 'error',
// don't allow default React import
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
importNames: ['default'],
message:
"As of React 17, you don't need to import React to use JSX. Please remove the default import.",
},
],
},
],
// don't allow unused styles
'react-native/no-unused-styles': 'error',
// make sure all maps have a key
'react/jsx-key': 'error',
// guard against leaked values in renders
'react/jsx-no-leaked-render': 'error',
},
overrides: [
{
// Test files only
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
},
],
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
},
};