-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
109 lines (108 loc) · 2.83 KB
/
Copy patheslint.config.js
File metadata and controls
109 lines (108 loc) · 2.83 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
109
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
//*@ts-check*
import { fixupConfigRules } from "@eslint/compat";
import js from "@eslint/js";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import prettier from "eslint-plugin-prettier"; // Import the Prettier plugin
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import storybook from "eslint-plugin-storybook";
import unicorn from "eslint-plugin-unicorn";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
js.configs.recommended,
tseslint.configs.recommended,
unicorn.configs["flat/recommended"],
{
rules: {
"unicorn/logical-assignment-operators": "off",
},
},
{
plugins: {
prettier: prettier,
},
rules: {
"prettier/prettier": [
"warn",
{
endOfLine: "auto",
},
],
},
},
...fixupConfigRules({
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
globals: globals.browser,
},
settings: {
react: {
version: "detect",
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
typescriptEslint,
"simple-import-sort": simpleImportSort,
react: react,
},
rules: {
...reactHooks.configs.recommended.rules,
"unicode-bom": "error",
"arrow-body-style": "error",
"prefer-arrow-callback": "error",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"simple-import-sort/imports": "error",
"react/no-children-prop": "error",
"no-restricted-imports": [
"error",
{
paths: [
{
name: "react",
importNames: ["default"],
message: "Импортируйте конкретные объекты, а не весь React.",
},
],
},
],
"react-refresh/only-export-components": [
"error",
{ allowConstantExport: true },
],
},
ignores: [
"src/services/*",
"dist/**",
"node_modules/**",
"**/*.md",
"build/**",
"vite.config.ts",
"obj/**",
],
}),
{
files: ["**/*.{js,ts,tsx}"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: "module",
},
},
},
eslintConfigPrettier,
storybook.configs["flat/recommended"]
);