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