-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy patheslint.config.js
70 lines (66 loc) · 2.1 KB
/
eslint.config.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
const { fixupPluginRules } = require("@eslint/compat");
const esLintReactNative = require("eslint-plugin-react-native");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
const hooksPlugin = require("eslint-plugin-react-hooks");
const tsEslint = require("typescript-eslint");
module.exports = [
...tsEslint.configs.recommended,
eslintPluginPrettierRecommended,
// Workaround for `eslint-plugin-react-native` not supporting eslint flat configs
// https://github.com/facebook/react-native/issues/42996#issuecomment-2275994981
{
name: "eslint-plugin-react-native",
plugins: {
"react-native": fixupPluginRules({
rules: esLintReactNative.rules,
}),
},
rules: {
...esLintReactNative.configs.all.rules,
"react-native/sort-styles": "off",
"react-native/no-inline-styles": "warn",
},
},
// Workaround for `eslint-plugin-react-hooks` not supporting eslint flat configs
// https://github.com/facebook/react/issues/28313#issuecomment-2379308650
{
plugins: {
"react-hooks": fixupPluginRules(hooksPlugin),
},
rules: hooksPlugin.configs.recommended.rules,
},
{
ignores: [
"scripts",
"example/web-build",
"node_modules/",
"**/lib/**",
"**/__generated__/**",
"jest-setup.js",
],
},
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"react-native/no-inline-styles": "off",
"react-native/no-color-literals": "off",
// ignore unused vars that start with underscore
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
];