-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
66 lines (61 loc) · 2.29 KB
/
eslint.config.js
File metadata and controls
66 lines (61 loc) · 2.29 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
// https://docs.expo.dev/guides/using-eslint/
const { defineConfig } = require("eslint/config");
const expoConfig = require("eslint-config-expo/flat");
const reactCompiler = require("eslint-plugin-react-compiler");
module.exports = defineConfig([
expoConfig,
reactCompiler.configs.recommended,
{
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "react-native",
importNames: ["Text"],
message:
"Use <AppText> instead of <Text>. The <AppText> component is located in 'components/ui/AppText'. We are using this because it has a custom font and some other features.",
},
{
name: "expo-image",
importNames: ["Image"],
message:
"Use <AppImage> instead of <Image>. The <AppImage> component is located in 'components/ui/AppImage'. We are using this because it can be styled with NativeWind and has some other features.",
},
{
name: "react-native",
importNames: ["Image"],
message:
"Use <AppImage> instead of <Image>. The <AppImage> component is located in 'components/ui/AppImage'. We are using this because it can be styled with NativeWind and has some other features.",
},
],
},
],
"no-restricted-syntax": [
"error",
{
selector: "JSXOpeningElement[name.name='Text']",
message:
"Use <AppText> instead of <Text>. The <AppText> component is located in 'components/ui/AppText'. We are using this because it has a custom font and some other features.",
},
{
selector: "JSXOpeningElement[name.name='Image']",
message:
"Use <AppImage> instead of <Image>. The <AppImage> component is located in 'components/ui/AppImage'. We are using this because it can be styled with NativeWind and has some other features.",
},
],
},
},
{
files: ["src/components/ui/AppText.tsx", "src/components/ui/AppImage.ts"],
rules: {
"no-restricted-imports": "off",
"no-restricted-syntax": "off",
},
},
{
ignores: ["dist/*"],
},
]);