-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy patheslint.config.js
More file actions
114 lines (112 loc) 路 3.66 KB
/
Copy patheslint.config.js
File metadata and controls
114 lines (112 loc) 路 3.66 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
110
111
112
113
114
import reactX from "eslint-plugin-react-x";
import {
defineConfig,
createBase,
disableRules,
} from "@local/eslint/deprecated";
export default [
...createBase(import.meta.dirname),
...disableRules([
/* 2022-11-29: 11 */ "@typescript-eslint/no-unsafe-argument",
/* 2022-11-29: 54 */ "@typescript-eslint/no-unsafe-assignment",
/* 2022-11-29: 30 */ "@typescript-eslint/no-unsafe-member-access",
/* 2022-11-29: 11 */ "@typescript-eslint/no-unsafe-return",
/* 2022-11-29: 34 */ "@typescript-eslint/restrict-template-expressions",
]),
...defineConfig([
{
plugins: {
"react-x": reactX,
},
rules: {
"jsx-a11y/label-has-associated-control": "off",
"import/no-default-export": "error",
"react-x/no-leaked-conditional-rendering": "error",
"no-restricted-imports": [
"error",
{
paths: [
{
name: "next",
importNames: ["Link"],
message:
"Please use the custom wrapper component in src/shared/ui component instead to ensure Next.js and MUI compatibility.",
},
{
name: "next/link",
message:
"Please use the custom wrapper component in src/shared/ui component instead to ensure Next.js and MUI compatibility.",
},
{
name: "@mui/material",
importNames: [
"Avatar",
"IconButton",
"Chip",
"TextField",
"Select",
"Link",
"Button",
"MenuItem",
"Tabs",
],
message:
"Please use the custom wrapper component from src/shared/ui for Link, Button, Tabs and MenuItem and from '@hashintel/design-system' for every other component.",
},
{
name: "notistack",
importNames: ["useSnackbar"],
message:
"Please use the custom src/components/hooks/useSnackbar hook instead.",
},
{
name: "@hashintel/design-system",
importNames: ["Button", "Link", "MenuItem"],
message:
"Please use the custom wrapper component in src/shared/ui component instead",
},
],
patterns: [
// @ts-expect-error: invalid typing
{
group: ["@mui/material/*"],
message: "Please import from @mui/material instead",
},
// @ts-expect-error: invalid typing
{
group: [
"@hashintel/design-system/*",
"!@hashintel/design-system/theme",
"!@hashintel/design-system/constants",
"!@hashintel/design-system/palettes",
],
message: "Please import from @hashintel/design-system instead",
},
],
},
],
},
},
{
files: [
"**/src/pages/**/*.api.ts",
"**/src/pages/**/*.page.ts",
"**/src/pages/**/*.page.tsx",
"**/__mocks__/**",
],
rules: {
"import/no-default-export": "off",
},
},
{
ignores: [
"buildstamp.js",
"next.config.js",
"next-env.d.ts",
// Outside the tsconfig project: imports `@hashintel/ds-components/preset`,
// an `exports` subpath the legacy `moduleResolution: "node"` cannot resolve
"panda.config.ts",
],
},
]),
];