-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
101 lines (90 loc) · 2.98 KB
/
eslint.config.mjs
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
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";
import pluginQuery from "@tanstack/eslint-plugin-query";
// 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";
/** @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.",
},
],
},
],
"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",
"typescript-eslint/no-unused-vars": [
"warn",
{
vars: "all",
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",
"prettier/prettier": "off",
"custom-plugin/padding-before-react-hooks": "warn",
},
settings: {
"import/resolver": {
typescript: true,
node: true,
},
react: {
version: "detect",
},
},
};
export default config;