This repository was archived by the owner on Jul 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy patheslint.config.mjs
More file actions
108 lines (98 loc) · 3.35 KB
/
eslint.config.mjs
File metadata and controls
108 lines (98 loc) · 3.35 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// While eslint-plugin-react-native fix to handle eslint flat config (https://github.com/Intellicode/eslint-plugin-react-native/issues/333#issuecomment-2150582430)
import { fixupPluginRules } from "@eslint/compat"
import pluginQuery from "@tanstack/eslint-plugin-query"
import pluginImport from "eslint-plugin-import"
import pluginReact from "eslint-plugin-react"
import pluginReactHooks from "eslint-plugin-react-hooks"
import pluginReactNative from "eslint-plugin-react-native"
import tsESLint from "typescript-eslint"
import customPlugin from "./custom-eslint-plugin/index.js"
/** @type {import('eslint').Linter.Config} */
const config = {
files: ["**/*.{ts,tsx}"],
ignores: [],
languageOptions: {
parser: tsESLint.parser,
},
plugins: {
"@tanstack/query": pluginQuery,
react: pluginReact,
"typescript-eslint": tsESLint.plugin,
import: pluginImport,
"react-hooks": pluginReactHooks,
"react-native": fixupPluginRules(pluginReactNative),
"custom-plugin": customPlugin,
},
rules: {
...tsESLint.configs["recommended"].rules,
...pluginReact.configs["recommended"].rules,
...pluginImport.configs["recommended"].rules,
...pluginReactHooks.configs["recommended"].rules,
...pluginReactNative.configs["all"].rules,
...pluginQuery.configs["recommended"].rules,
"@tanstack/query/exhaustive-deps": "error",
"@tanstack/query/no-rest-destructuring": "warn",
"@tanstack/query/stable-query-client": "error",
"@tanstack/query/no-unstable-deps": "warn",
"import/no-unresolved": "off",
"import/no-relative-parent-imports": "off",
"import/no-default-export": "warn",
"import/order": "off",
"no-restricted-imports": [
"error",
{
paths: [
{
name: "i18n-js",
message: "Use @i18n app module instead.",
},
{
name: "react-native-reanimated",
importNames: ["useAnimatedKeyboard"],
message:
"Do not use useAnimatedKeyboard from react-native-reanimated. Use our custom keyboard hook instead.",
},
],
},
],
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react-native/no-raw-text": "off",
"react-native/no-color-literals": "warn",
"react-native/sort-styles": "off",
"react-native/no-unused-styles": "off",
"react-native/no-inline-styles": "warn",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"react/display-name": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-key": "error",
"react/jsx-no-bind": "off",
"react/jsx-no-target-blank": "off", // Was causing weird eslint issues
"typescript-eslint/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "none",
ignoreRestSiblings: true,
},
],
"typescript-eslint/no-explicit-any": "warn",
"typescript-eslint/explicit-function-return-type": "off",
"typescript-eslint/consistent-type-definitions": ["warn", "type"],
"padding-line-between-statements": "off",
"custom-plugin/padding-before-react-hooks": "warn",
"custom-plugin/require-promise-error-handling": "warn",
},
settings: {
"import/resolver": {
typescript: true,
node: true,
},
react: {
version: "detect",
},
},
}
export default config