forked from react-navigation/react-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
78 lines (78 loc) · 1.89 KB
/
.eslintrc.js
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
module.exports = {
root: true,
extends: 'satya164',
plugins: ['simple-import-sort'],
settings: {
'react': {
version: '16',
},
'import-x/core-modules': [
'@react-navigation/core',
'@react-navigation/native',
'@react-navigation/routers',
'@react-navigation/stack',
'@react-navigation/native-stack',
'@react-navigation/drawer',
'@react-navigation/bottom-tabs',
'@react-navigation/material-top-tabs',
'@react-navigation/elements',
'@react-navigation/devtools',
'react-native-drawer-layout',
'react-native-tab-view',
],
},
env: {
browser: true,
node: true,
},
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['@react-navigation/*/*'],
paths: [
{
name: 'react-native',
importNames: ['Text'],
message: 'Import `Text` from `@react-navigation/elements` instead.',
},
{
name: '@react-navigation/core',
message: 'Import from `@react-navigation/native` instead.',
},
],
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'import-x/no-default-export': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
overrides: [
{
files: ['packages/{native,devtools}/src/**'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['@react-navigation/*/*'],
paths: [],
},
],
},
},
{
files: ['scripts/*.js', 'netlify/functions/**/*.js'],
rules: {
'import-x/no-commonjs': 'off',
},
},
{
files: ['*.config.{ts,mts,js,cjs,mjs}', '.*rc.{ts,mts,js,cjs,mjs}'],
rules: {
'import-x/no-default-export': 'off',
},
},
],
};