-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
93 lines (83 loc) · 2.12 KB
/
Copy patheslint.config.mjs
File metadata and controls
93 lines (83 loc) · 2.12 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
import prettyCozy from "@pretty-cozy/eslint-config"
import { defineConfig, globalIgnores } from "eslint/config"
import storybook from "eslint-plugin-storybook"
import testingLibrary from "eslint-plugin-testing-library"
const storybookConfig = defineConfig({
basePath: "./docs",
rules: {
"import-x/no-extraneous-dependencies": "off",
},
extends: [
// eslint-disable-next-line import-x/no-named-as-default-member
storybook.configs["flat/recommended"],
{
name: "local-rules/check-file-naming",
files: [".storybook/**"],
rules: {
"check-file/folder-naming-convention": "off",
"storybook/no-uninstalled-addons": "off",
},
},
{
name: "local-rules/lib-imports",
files: ["src/**"],
ignores: ["src/lib/**"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["@yaasl/*"],
importNamePattern: "^",
message: "Import from lib/yaasl instead.",
},
],
},
],
},
},
],
})
export default defineConfig(
prettyCozy.baseTs,
prettyCozy.react,
prettyCozy.tailwind({ entryPoint: "docs/src/index.css" }),
prettyCozy.vitest,
globalIgnores(["dist", "node_modules", "!./docs/.storybook"]),
storybookConfig,
{
files: ["tests", "src/**/*.test.*"],
extends: [testingLibrary.configs["flat/react"]],
},
{
rules: {
complexity: ["error", 12],
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports", prefer: "type-imports" },
],
},
},
{
name: "local-rules/lib-imports",
files: ["src/**"],
ignores: ["src/components/icons/**"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["lucide-react"],
importNamePattern: "^",
message: "Import from /components/icons instead.",
},
],
},
],
},
},
prettyCozy.prettier
)