@cocopalm/oxc-linter-config 0.0.21 → 0.0.23
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.ko.md +136 -0
- package/README.md +21 -19
- package/package.json +1 -1
package/README.ko.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# oxc-linter-config
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | [한국어](./README.ko.md)
|
|
4
|
+
|
|
5
|
+
이 패키지는 oxc-linter용 공통 린트 설정을 제공합니다.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D oxlint @cocopalm/oxc-linter-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## How to use
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
packages/oxc-linter-config/
|
|
17
|
+
├── oxlint-common.json # 모든 프로젝트에 공통 적용
|
|
18
|
+
├── oxlint-react.json # React/Next.js 프로젝트용
|
|
19
|
+
└── oxlint-node.json # Node.js 프로젝트용
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### .oxlintrc.json 설정하기
|
|
23
|
+
|
|
24
|
+
프로젝트 루트 디렉토리에 `.oxlintrc.json` 을 생성합니다.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
touch .oxlintrc.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
적용하고자 하는 린트 규칙을 `extends` 필드에 정의합니다.
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
// .oxlintrc.json
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
"extends": [
|
|
37
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-common.json",
|
|
38
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-react.json"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`package.json` 에 린트 스크립트를 추가해주세요.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
// package.json
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
"scripts": {
|
|
50
|
+
"lint": "oxlint .",
|
|
51
|
+
"lint:fix": "oxlint . --fix"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### rule overrides
|
|
57
|
+
|
|
58
|
+
린트 규칙을 오버라이드하고 싶다면 `overrides` 필드를 사용합니다.
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"extends": [
|
|
63
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-common.json",
|
|
64
|
+
"node_modules/@cocopalm/oxc-linter-config/oxlint-react.json"
|
|
65
|
+
],
|
|
66
|
+
"overrides": [
|
|
67
|
+
{
|
|
68
|
+
"files": ["**/*.{ts,tsx}"],
|
|
69
|
+
"rules": {
|
|
70
|
+
"eslint/no-unused-vars": "off"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
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
|
+
|
|
116
|
+
<br />
|
|
117
|
+
|
|
118
|
+
## Description
|
|
119
|
+
|
|
120
|
+
기존에 널리 사용중인 eslint-plugin을 oxc-linter에서 사용할 수 있도록 포팅하는 작업이 진행중입니다.
|
|
121
|
+
진행상황을 확인하고 싶다면 다음 이슈를 참고해주세요.
|
|
122
|
+
|
|
123
|
+
👉 [github issue](https://github.com/oxc-project/oxc/issues/481)
|
|
124
|
+
|
|
125
|
+
<br />
|
|
126
|
+
|
|
127
|
+
## Caveat
|
|
128
|
+
|
|
129
|
+
1. v1 기준으로 다음 eslint-plugin들의 **`not recommended`** 규칙들은 미구현 상태로 인해서 현재 적용되어있지 않습니다.
|
|
130
|
+
|
|
131
|
+
- [eslint-core](./docs/eslint-core.md)
|
|
132
|
+
- [eslint-react](./docs/eslint-react.md)
|
|
133
|
+
|
|
134
|
+
2. `react compiler` 관련 규칙들은 아직 oxc linter react plugin에서 지원하지 않기 때문에 적용되어있지 않습니다.
|
|
135
|
+
|
|
136
|
+
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# oxc-linter-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](./README.md) | [한국어](./README.ko.md)
|
|
4
|
+
|
|
5
|
+
This package provides shared lint configurations for oxc-linter.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -12,20 +14,20 @@ pnpm add -D oxlint @cocopalm/oxc-linter-config
|
|
|
12
14
|
|
|
13
15
|
```
|
|
14
16
|
packages/oxc-linter-config/
|
|
15
|
-
├── oxlint-common.json #
|
|
16
|
-
├── oxlint-react.json # React/Next.js
|
|
17
|
-
└── oxlint-node.json # Node.js
|
|
17
|
+
├── oxlint-common.json # Common rules for all projects
|
|
18
|
+
├── oxlint-react.json # For React/Next.js projects
|
|
19
|
+
└── oxlint-node.json # For Node.js projects
|
|
18
20
|
```
|
|
19
21
|
|
|
20
|
-
### .oxlintrc.json
|
|
22
|
+
### Setting up .oxlintrc.json
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Create a `.oxlintrc.json` file in your project root directory.
|
|
23
25
|
|
|
24
26
|
```bash
|
|
25
27
|
touch .oxlintrc.json
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
Define the lint rules you want to apply in the `extends` field.
|
|
29
31
|
|
|
30
32
|
```json
|
|
31
33
|
// .oxlintrc.json
|
|
@@ -38,7 +40,7 @@ touch .oxlintrc.json
|
|
|
38
40
|
}
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
`package.json
|
|
43
|
+
Add lint scripts to your `package.json`.
|
|
42
44
|
|
|
43
45
|
```json
|
|
44
46
|
// package.json
|
|
@@ -51,9 +53,9 @@ touch .oxlintrc.json
|
|
|
51
53
|
}
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
###
|
|
56
|
+
### Rule overrides
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
If you want to override lint rules, use the `overrides` field.
|
|
57
59
|
|
|
58
60
|
```json
|
|
59
61
|
{
|
|
@@ -74,7 +76,7 @@ touch .oxlintrc.json
|
|
|
74
76
|
|
|
75
77
|
### Examples
|
|
76
78
|
|
|
77
|
-
1. **Common
|
|
79
|
+
1. **Common rules only** (vanilla JS/TS projects)
|
|
78
80
|
|
|
79
81
|
```json
|
|
80
82
|
{
|
|
@@ -82,7 +84,7 @@ touch .oxlintrc.json
|
|
|
82
84
|
}
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
2. **React
|
|
87
|
+
2. **React projects**
|
|
86
88
|
|
|
87
89
|
```json
|
|
88
90
|
{
|
|
@@ -93,7 +95,7 @@ touch .oxlintrc.json
|
|
|
93
95
|
}
|
|
94
96
|
```
|
|
95
97
|
|
|
96
|
-
3. **Node.js
|
|
98
|
+
3. **Node.js projects**
|
|
97
99
|
```json
|
|
98
100
|
{
|
|
99
101
|
"extends": [
|
|
@@ -107,16 +109,16 @@ touch .oxlintrc.json
|
|
|
107
109
|
|
|
108
110
|
## Lint Rules
|
|
109
111
|
|
|
110
|
-
|
|
112
|
+
To learn about all lint rules applied in each configuration file and the reasoning behind them, please refer to the following document.
|
|
111
113
|
|
|
112
|
-
👉 [Linter Rules
|
|
114
|
+
👉 [Linter Rules Reference](./docs/linter-rules.md)
|
|
113
115
|
|
|
114
116
|
<br />
|
|
115
117
|
|
|
116
118
|
## Description
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
Work is in progress to port widely used eslint-plugins for use with oxc-linter.
|
|
121
|
+
To check the progress, please refer to the following issue.
|
|
120
122
|
|
|
121
123
|
👉 [github issue](https://github.com/oxc-project/oxc/issues/481)
|
|
122
124
|
|
|
@@ -124,11 +126,11 @@ touch .oxlintrc.json
|
|
|
124
126
|
|
|
125
127
|
## Caveat
|
|
126
128
|
|
|
127
|
-
1.
|
|
129
|
+
1. As of v1, the **`not recommended`** rules from the following eslint-plugins are not yet applied due to being unimplemented.
|
|
128
130
|
|
|
129
131
|
- [eslint-core](./docs/eslint-core.md)
|
|
130
132
|
- [eslint-react](./docs/eslint-react.md)
|
|
131
133
|
|
|
132
|
-
2. `react compiler`
|
|
134
|
+
2. `react compiler` related rules are not applied because the oxc linter react plugin does not yet support them.
|
|
133
135
|
|
|
134
136
|
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|