-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
96 lines (88 loc) ยท 2.8 KB
/
Copy patheslint.config.js
File metadata and controls
96 lines (88 loc) ยท 2.8 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
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import { defineConfig, globalIgnores } from "eslint/config";
import prettierConfig from "eslint-config-prettier";
// ๋ชจ์
๊ฐ๋ ์
๋ ํฐ โ raw <button> ๊ฐ๋ ๋ธ๋ก์์๋ ์ฌ์ฌ์ฉ
const motionGuardSelectors = [
{
selector: "Literal[value=/\\btransition-all\\b/]",
message:
"transition-all ๊ธ์ง: ์ ๋๋ฉ์ด์
ํ ์์ฑ์ ๋ช
์ํ๊ณ ํ ํฐ(var(--duration-*)/var(--ease-*))์ ์ฐ์ธ์.",
},
{
selector: "TemplateElement[value.raw=/\\btransition-all\\b/]",
message: "transition-all ๊ธ์ง: ์ ๋๋ฉ์ด์
ํ ์์ฑ์ ๋ช
์ํ๊ณ ํ ํฐ์ ์ฐ์ธ์.",
},
{
selector: "Literal[value=/\\banimate-pulse\\b/]",
message: "animate-pulse ๊ธ์ง: t-skel-sheen ์ค์ผ๋ ํค ํจํด์ ์ฐ์ธ์.",
},
{
selector: "TemplateElement[value.raw=/\\banimate-pulse\\b/]",
message: "animate-pulse ๊ธ์ง: t-skel-sheen ์ค์ผ๋ ํค ํจํด์ ์ฐ์ธ์.",
},
{
selector: "Literal[value=/duration-\\[[0-9]/]",
message: "์์ duration ๊ธ์ง: duration-[var(--duration-*)] ํ ํฐ์ ์ฐ์ธ์.",
},
{
selector: "TemplateElement[value.raw=/duration-\\[[0-9]/]",
message: "์์ duration ๊ธ์ง: duration-[var(--duration-*)] ํ ํฐ์ ์ฐ์ธ์.",
},
];
export default defineConfig([
globalIgnores([
"dist",
"build",
"coverage",
"node_modules",
"android",
"ios",
]),
{
files: ["**/*.{js,jsx,ts,tsx}"],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
prettierConfig,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
rules: {
"react-hooks/set-state-in-effect": "off",
"react-hooks/refs": "off",
"react-hooks/exhaustive-deps": "off",
},
},
// ๋ชจ์
๊ฐ๋
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/pages/demoDay/**"],
rules: {
"no-restricted-syntax": ["error", ...motionGuardSelectors],
},
},
// raw <button> ๊ฐ๋ โ ํญ ํผ๋๋ฐฑ์ Press๊ฐ ์์ ํ๋ฏ๋ก ๊ณต์ฉ ์ปดํฌ๋ํธ ๋ด๋ถ์์๋ง ํ์ฉ
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/pages/demoDay/**", "src/components/common/**"],
rules: {
"no-restricted-syntax": [
"error",
...motionGuardSelectors,
{
selector: "JSXOpeningElement[name.name='button']",
message:
"raw <button> ๊ธ์ง: Press/CTA_Button ๋ฑ ๊ณต์ฉ ์ปดํฌ๋ํธ๋ฅผ ์ฐ์ธ์. (์คํฌ๋ฆผยท๋ํธ ๋ฑ ์๋์ ๋ฏธ์ ์ฉ์ disable ์ฃผ์์ผ๋ก ์ฌ์ ๋ฅผ ๋จ๊ธธ ๊ฒ)",
},
],
},
},
]);