@cocopalm/oxc-formatter-config 0.0.22 → 0.0.24
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 +22 -28
- package/README.md +22 -28
- package/oxfmt.config.js +11 -0
- package/package.json +6 -8
- package/prettier.config.js +0 -16
package/README.ko.md
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | [한국어](./README.ko.md)
|
|
4
4
|
|
|
5
|
-
이 패키지는
|
|
5
|
+
이 패키지는 [oxfmt](https://oxc.rs/docs/guide/usage/formatter)를 사용한 코드 포맷팅 설정을 제공합니다.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pnpm add -D
|
|
10
|
+
pnpm add -D oxfmt @cocopalm/oxc-formatter-config
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## How to use
|
|
14
14
|
|
|
15
|
-
### .
|
|
15
|
+
### oxfmt.config.ts 설정하기
|
|
16
16
|
|
|
17
|
-
프로젝트 루트 디렉토리에
|
|
17
|
+
프로젝트 루트 디렉토리에 `oxfmt.config.ts` 파일을 생성합니다.
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
touch .
|
|
20
|
+
touch oxfmt.config.ts
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
설정 파일에서 `@cocopalm/oxc-formatter-config`를 불러옵니다.
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
// .
|
|
26
|
+
// oxfmt.config.ts
|
|
27
27
|
|
|
28
28
|
import config from '@cocopalm/oxc-formatter-config'
|
|
29
29
|
|
|
@@ -37,8 +37,8 @@ export default config
|
|
|
37
37
|
|
|
38
38
|
{
|
|
39
39
|
"scripts": {
|
|
40
|
-
"format": "
|
|
41
|
-
"format:check": "
|
|
40
|
+
"format": "oxfmt .",
|
|
41
|
+
"format:check": "oxfmt . --check"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
```
|
|
@@ -47,23 +47,18 @@ export default config
|
|
|
47
47
|
|
|
48
48
|
기본 설정을 오버라이드하고 싶다면 다음과 같이 설정을 확장할 수 있습니다.
|
|
49
49
|
|
|
50
|
-
```
|
|
51
|
-
// .
|
|
50
|
+
```ts
|
|
51
|
+
// oxfmt.config.ts
|
|
52
52
|
|
|
53
|
+
import { defineConfig } from 'oxfmt'
|
|
53
54
|
import baseConfig from '@cocopalm/oxc-formatter-config'
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
* @see https://prettier.io/docs/configuration
|
|
57
|
-
* @type {import("prettier").Config}
|
|
58
|
-
*/
|
|
59
|
-
const config = {
|
|
56
|
+
export default defineConfig({
|
|
60
57
|
...baseConfig,
|
|
61
58
|
// 여기에 오버라이딩 설정을 작성할 수 있습니다.
|
|
62
59
|
printWidth: 100,
|
|
63
60
|
semi: true,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default config
|
|
61
|
+
})
|
|
67
62
|
```
|
|
68
63
|
|
|
69
64
|
|
|
@@ -73,15 +68,14 @@ export default config
|
|
|
73
68
|
|
|
74
69
|
이 패키지에 적용된 기본 포맷팅 옵션은 다음과 같습니다:
|
|
75
70
|
|
|
76
|
-
| 옵션
|
|
77
|
-
|
|
|
78
|
-
| printWidth
|
|
79
|
-
| tabWidth
|
|
80
|
-
| useTabs
|
|
81
|
-
| semi
|
|
82
|
-
| singleQuote
|
|
83
|
-
| trailingComma
|
|
84
|
-
| arrowParens
|
|
85
|
-
| plugins | [@prettier/plugin-oxc] | OXC 플러그인 사용 |
|
|
71
|
+
| 옵션 | 값 | 설명 |
|
|
72
|
+
| ------------- | -------- | --------------------------------------------- |
|
|
73
|
+
| printWidth | 80 | 한 줄의 최대 길이 |
|
|
74
|
+
| tabWidth | 2 | 들여쓰기 공백 수 |
|
|
75
|
+
| useTabs | false | 탭 대신 공백 사용 |
|
|
76
|
+
| semi | false | 문장 끝 세미콜론 제거 |
|
|
77
|
+
| singleQuote | true | 작은따옴표 사용 |
|
|
78
|
+
| trailingComma | 'all' | 가능한 모든 곳에 trailing comma 추가 |
|
|
79
|
+
| arrowParens | 'always' | 화살표 함수 매개변수에 항상 괄호 사용 |
|
|
86
80
|
|
|
87
81
|
<br />
|
package/README.md
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | [한국어](./README.ko.md)
|
|
4
4
|
|
|
5
|
-
This package provides code formatting configuration using
|
|
5
|
+
This package provides code formatting configuration using [oxfmt](https://oxc.rs/docs/guide/usage/formatter).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pnpm add -D
|
|
10
|
+
pnpm add -D oxfmt @cocopalm/oxc-formatter-config
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## How to use
|
|
14
14
|
|
|
15
|
-
### Setting up .
|
|
15
|
+
### Setting up oxfmt.config.ts
|
|
16
16
|
|
|
17
|
-
Create
|
|
17
|
+
Create an `oxfmt.config.ts` file in your project root directory.
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
touch .
|
|
20
|
+
touch oxfmt.config.ts
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Import `@cocopalm/oxc-formatter-config` in your configuration file.
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
// .
|
|
26
|
+
// oxfmt.config.ts
|
|
27
27
|
|
|
28
28
|
import config from '@cocopalm/oxc-formatter-config'
|
|
29
29
|
|
|
@@ -37,8 +37,8 @@ Add formatting scripts to your `package.json`.
|
|
|
37
37
|
|
|
38
38
|
{
|
|
39
39
|
"scripts": {
|
|
40
|
-
"format": "
|
|
41
|
-
"format:check": "
|
|
40
|
+
"format": "oxfmt .",
|
|
41
|
+
"format:check": "oxfmt . --check"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
```
|
|
@@ -47,23 +47,18 @@ Add formatting scripts to your `package.json`.
|
|
|
47
47
|
|
|
48
48
|
If you want to override the default settings, you can extend the configuration as follows.
|
|
49
49
|
|
|
50
|
-
```
|
|
51
|
-
// .
|
|
50
|
+
```ts
|
|
51
|
+
// oxfmt.config.ts
|
|
52
52
|
|
|
53
|
+
import { defineConfig } from 'oxfmt'
|
|
53
54
|
import baseConfig from '@cocopalm/oxc-formatter-config'
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
* @see https://prettier.io/docs/configuration
|
|
57
|
-
* @type {import("prettier").Config}
|
|
58
|
-
*/
|
|
59
|
-
const config = {
|
|
56
|
+
export default defineConfig({
|
|
60
57
|
...baseConfig,
|
|
61
58
|
// Add your custom overrides here.
|
|
62
59
|
printWidth: 100,
|
|
63
60
|
semi: true,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default config
|
|
61
|
+
})
|
|
67
62
|
```
|
|
68
63
|
|
|
69
64
|
|
|
@@ -73,15 +68,14 @@ export default config
|
|
|
73
68
|
|
|
74
69
|
The default formatting options applied in this package are as follows:
|
|
75
70
|
|
|
76
|
-
| Option
|
|
77
|
-
|
|
|
78
|
-
| printWidth
|
|
79
|
-
| tabWidth
|
|
80
|
-
| useTabs
|
|
81
|
-
| semi
|
|
82
|
-
| singleQuote
|
|
83
|
-
| trailingComma
|
|
84
|
-
| arrowParens
|
|
85
|
-
| plugins | [@prettier/plugin-oxc] | Use OXC plugin |
|
|
71
|
+
| Option | Value | Description |
|
|
72
|
+
| ------------- | ------- | ------------------------------------------------------------ |
|
|
73
|
+
| printWidth | 80 | Maximum line length |
|
|
74
|
+
| tabWidth | 2 | Number of spaces for indentation |
|
|
75
|
+
| useTabs | false | Use spaces instead of tabs |
|
|
76
|
+
| semi | false | Omit semicolons at the end of statements |
|
|
77
|
+
| singleQuote | true | Use single quotes |
|
|
78
|
+
| trailingComma | 'all' | Add trailing commas wherever possible |
|
|
79
|
+
| arrowParens | 'always'| Always wrap arrow function parameters in parentheses |
|
|
86
80
|
|
|
87
81
|
<br />
|
package/oxfmt.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocopalm/oxc-formatter-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "oxc formatter configuration",
|
|
5
5
|
"author": "puffcocos",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "./
|
|
8
|
+
"main": "./oxfmt.config.js",
|
|
9
9
|
"files": [
|
|
10
|
-
"
|
|
10
|
+
"oxfmt.config.js"
|
|
11
11
|
],
|
|
12
12
|
"keywords": [
|
|
13
13
|
"oxc",
|
|
14
|
-
"
|
|
14
|
+
"oxfmt",
|
|
15
15
|
"formatter",
|
|
16
16
|
"config"
|
|
17
17
|
],
|
|
@@ -24,11 +24,9 @@
|
|
|
24
24
|
"provenance": true
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"@prettier/plugin-oxc": "^0.1.3"
|
|
27
|
+
"oxfmt": "^0.42.0"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"@prettier/plugin-oxc": "^0.1.3"
|
|
30
|
+
"oxfmt": ">=0.42.0"
|
|
33
31
|
}
|
|
34
32
|
}
|
package/prettier.config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @see https://prettier.io/docs/configuration
|
|
3
|
-
* @type {import("prettier").Config}
|
|
4
|
-
*/
|
|
5
|
-
const config = {
|
|
6
|
-
printWidth: 80,
|
|
7
|
-
tabWidth: 2,
|
|
8
|
-
useTabs: false,
|
|
9
|
-
semi: false,
|
|
10
|
-
singleQuote: true,
|
|
11
|
-
trailingComma: 'all',
|
|
12
|
-
arrowParens: 'always',
|
|
13
|
-
plugins: ['@prettier/plugin-oxc'],
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default config
|