-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
129 lines (128 loc) · 2.79 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import css from "@eslint/css";
import eslint from "@eslint/js";
import graphql from "@graphql-eslint/eslint-plugin";
import prettier from "eslint-config-prettier";
import i18next from "eslint-plugin-i18next";
import importPlugin from "eslint-plugin-import-x";
import jsxA11y from "eslint-plugin-jsx-a11y";
import react from "eslint-plugin-react";
import * as reactHooks from "eslint-plugin-react-hooks";
import * as regexp from "eslint-plugin-regexp";
import globals from "globals";
import { config, configs } from "typescript-eslint";
/** @type {import('eslint').Config} */
export default config(
eslint.configs.recommended,
...configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
jsxA11y.flatConfigs.recommended,
react.configs.flat.recommended,
react.configs.flat["jsx-runtime"],
reactHooks.configs["recommended-latest"],
regexp.configs["flat/recommended"],
i18next.configs["flat/recommended"],
{
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2022,
...globals.serviceworker,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
sourceType: "module",
},
rules: {
...react.configs["jsx-runtime"].rules,
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"import-x/no-dynamic-require": "warn",
"no-unused-vars": "off",
"react/no-unknown-property": [
"error",
{
ignore: ["variant"],
},
],
"react/jsx-sort-props": [
"warn",
{
callbacksLast: false,
shorthandFirst: false,
shorthandLast: false,
multiline: "ignore",
ignoreCase: true,
noSortAlphabetically: false,
reservedFirst: false,
locale: "auto",
},
],
},
settings: {
"import-x/internal-regex": "^~/",
"import-x/parsers": {
"typescript-eslint": [".ts", ".tsx"],
},
"import-x/resolver": {
node: true,
typescript: true,
},
react: {
version: "detect",
},
},
},
{
ignores: [
"**/+types/*",
"**/build/*",
"**/dist/*",
"**/generated/*",
"**/node_modules/*",
"**/types/*",
],
},
{
files: ["**/*.css"],
language: "css/css",
...css.configs.recommended,
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
processor: graphql.processor,
},
{
files: ["**/*.graphql"],
languageOptions: {
parser: graphql.parser,
},
plugins: {
"@graphql-eslint": graphql,
},
rules: {
"@graphql-eslint/no-anonymous-operations": "error",
"@graphql-eslint/no-duplicate-fields": "error",
},
},
prettier,
);