@cocopalm/oxc-linter-config 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -10
- package/oxlint-common.json +8 -1
- package/oxlint-node.json +9 -1
- package/oxlint-react.json +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,13 +10,22 @@ pnpm add oxlint @cocopalm/oxc-linter-config
|
|
|
10
10
|
|
|
11
11
|
## How to use
|
|
12
12
|
|
|
13
|
+
```
|
|
14
|
+
packages/oxc-linter-config/
|
|
15
|
+
├── oxlint-common.json # 모든 프로젝트에 공통 적용
|
|
16
|
+
├── oxlint-react.json # React/Next.js 프로젝트용
|
|
17
|
+
└── oxlint-node.json # Node.js 프로젝트용
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### .oxlintrc.json 설정하기
|
|
21
|
+
|
|
13
22
|
프로젝트 루트 디렉토리에 `.oxlintrc.json` 을 생성합니다.
|
|
14
23
|
|
|
15
24
|
```bash
|
|
16
25
|
touch .oxlintrc.json
|
|
17
26
|
```
|
|
18
27
|
|
|
19
|
-
적용하고자 하는 린트 규칙을 `extends` 필드에
|
|
28
|
+
적용하고자 하는 린트 규칙을 `extends` 필드에 정의합니다.
|
|
20
29
|
|
|
21
30
|
```json
|
|
22
31
|
// .oxlintrc.json
|
|
@@ -29,16 +38,11 @@ touch .oxlintrc.json
|
|
|
29
38
|
}
|
|
30
39
|
```
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
- `javascript`, `typescript`, `import` 와 같은 공용 린트 플러그인입니다.
|
|
34
|
-
- `oxlint-react.json`
|
|
35
|
-
- `Next.js` 기반 프론트엔드 서비스의 린트 플러그인입니다.
|
|
36
|
-
- `oxlint-node.json`
|
|
37
|
-
- `node.js` 기반 백엔드 서비스의 린트 플러그인입니다.
|
|
38
|
-
|
|
39
|
-
린트 러너 스크립트를 `package.json` 에 추가해주세요.
|
|
41
|
+
`package.json` 에 린트 스크립트를 추가해주세요.
|
|
40
42
|
|
|
41
43
|
```json
|
|
44
|
+
// package.json
|
|
45
|
+
|
|
42
46
|
{
|
|
43
47
|
"scripts": {
|
|
44
48
|
"lint": "oxlint .",
|
|
@@ -47,7 +51,11 @@ touch .oxlintrc.json
|
|
|
47
51
|
}
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
### rule overrides (TBD)
|
|
55
|
+
|
|
56
|
+
> ⚠️ 현재 overrides 동작에 이슈가 있어서 사용이 어렵습니다.
|
|
57
|
+
|
|
58
|
+
린트 규칙을 오버라이드하고 싶다면 `overrides` 필드를 사용합니다.
|
|
51
59
|
|
|
52
60
|
```json
|
|
53
61
|
{
|
|
@@ -66,6 +74,45 @@ touch .oxlintrc.json
|
|
|
66
74
|
}
|
|
67
75
|
```
|
|
68
76
|
|
|
77
|
+
### Examples
|
|
78
|
+
|
|
79
|
+
1. **Common 규칙만 사용** (vanilla JS/TS 프로젝트)
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"extends": ["node_modules/@cocopalm/oxc-linter-config/oxlint-common.json"]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
2. **React 프로젝트**
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"extends": [
|
|
92
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-common.json",
|
|
93
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-react.json"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
3. **Node.js 프로젝트**
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"extends": [
|
|
102
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-common.json",
|
|
103
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-node.json"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
<br />
|
|
109
|
+
|
|
110
|
+
## Lint Rules
|
|
111
|
+
|
|
112
|
+
각 설정 파일에 적용된 모든 린트 규칙과 각 규칙을 추가한 이유에 대해 알고 싶다면 다음 문서를 참고해주세요.
|
|
113
|
+
|
|
114
|
+
👉 [Linter Rules 설명서](./docs/linter-rules.md)
|
|
115
|
+
|
|
69
116
|
<br />
|
|
70
117
|
|
|
71
118
|
## Description
|
package/oxlint-common.json
CHANGED
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"error",
|
|
43
43
|
{ "argsIgnorePattern": "^_+$", "ignoreRestSiblings": true }
|
|
44
44
|
],
|
|
45
|
-
|
|
46
45
|
"typescript/array-type": ["error", { "default": "array" }],
|
|
47
46
|
"typescript/consistent-indexed-object-style": ["error", "record"],
|
|
48
47
|
"typescript/consistent-type-definitions": ["error", "interface"],
|
|
@@ -56,5 +55,13 @@
|
|
|
56
55
|
"typescript/prefer-literal-enum-member": "error"
|
|
57
56
|
}
|
|
58
57
|
}
|
|
58
|
+
],
|
|
59
|
+
"ignorePatterns": [
|
|
60
|
+
"node_modules/**",
|
|
61
|
+
"out/**",
|
|
62
|
+
"build/**",
|
|
63
|
+
"dist/**",
|
|
64
|
+
".next/**",
|
|
65
|
+
"next-env.d.ts"
|
|
59
66
|
]
|
|
60
67
|
}
|
package/oxlint-node.json
CHANGED
package/oxlint-react.json
CHANGED
|
@@ -22,6 +22,24 @@
|
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
24
|
"react/style-prop-object": "error",
|
|
25
|
-
"react/void-dom-elements-no-children": "error"
|
|
26
|
-
|
|
25
|
+
"react/void-dom-elements-no-children": "error",
|
|
26
|
+
"jsx_a11y/click-events-have-key-events": "off",
|
|
27
|
+
"jsx_a11y/img-redundant-alt": "warn",
|
|
28
|
+
"jsx_a11y/media-has-caption": "off",
|
|
29
|
+
"jsx_a11y/mouse-events-have-key-events": "off",
|
|
30
|
+
"jsx_a11y/no-noninteractive-tabindex": "warn",
|
|
31
|
+
"jsx_a11y/no-redundant-roles": "warn",
|
|
32
|
+
"jsx_a11y/role-has-required-aria-props": "warn",
|
|
33
|
+
"jsx_a11y/role-supports-aria-props": "warn",
|
|
34
|
+
"jsx_a11y/tabindex-no-positive": "warn",
|
|
35
|
+
"jsx_a11y/prefer-tag-over-role": "warn"
|
|
36
|
+
},
|
|
37
|
+
"ignorePatterns": [
|
|
38
|
+
"node_modules/**",
|
|
39
|
+
"out/**",
|
|
40
|
+
"build/**",
|
|
41
|
+
"dist/**",
|
|
42
|
+
".next/**",
|
|
43
|
+
"next-env.d.ts"
|
|
44
|
+
]
|
|
27
45
|
}
|