Skip to content

Commit 8ee4915

Browse files
๐Ÿ“ update: translate README to English and improve clarity of installation and configuration instructions
1 parent b571f54 commit 8ee4915

File tree

2 files changed

+112
-11
lines changed

2 files changed

+112
-11
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# @naverpay/stylelint-config
2+
3+
๋„ค์ด๋ฒ„ํŽ˜์ด ์Šคํƒ€์ผ ๊ฐ€์ด๋“œ์— ๋งž๊ฒŒ stylelint-config ํŒจํ‚ค์ง€๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
4+
5+
## Install
6+
7+
**stylelint**, **@naverpay/stylelint-config** ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.
8+
9+
```bash
10+
npm install -D stylelint@^16 @naverpay/stylelint-config
11+
```
12+
13+
## Configure
14+
15+
`stylelint.config.mjs` ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. `defaultSeverity` ์˜ default ๊ฐ’์€ `warning` ์ž…๋‹ˆ๋‹ค.
16+
17+
```js
18+
/** @type {import('stylelint').Config} */
19+
const config = {
20+
extends: ['@naverpay/stylelint-config'],
21+
defaultSeverity: 'error',
22+
rules: {},
23+
}
24+
25+
export default config
26+
```
27+
28+
> pure esm ๋งŒ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. `.mjs`๋กœ ํŒŒ์ผ์„ ๋งŒ๋“œ์‹œ๊ฑฐ๋‚˜, `type: "module"`์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
29+
30+
## CLI
31+
32+
package.json์— ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ format ๊ฒ€์‚ฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
33+
34+
```jsonc
35+
// package.json
36+
{
37+
"scripts": {
38+
"stylelint": "stylelint '**/*.{css,scss}'",
39+
"stylelint:fix": "stylelint --fix '**/*.{css,scss}'",
40+
},
41+
}
42+
```
43+
44+
> - `[email protected]` ๋ฒ„์ „ ๋ถ€ํ„ฐ prettier ๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋Š” ์ผ์„ prettier ์— ์œ„์ž„ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์—, stylelint ๊ฐ€ ๊ฒ€์‚ฌํ•˜๋Š” ํŒŒ์ผ์€ ๋ฐ˜๋“œ์‹œ `prettier`๋„ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. <https://github.com/stylelint/stylelint/blob/1c17fb87a2f16f041632e380dd0d600cb3532337/docs/migration-guide/to-15.md>
45+
> - [lefthook](https://github.com/evilmartians/lefthook)์„ ์‚ฌ์šฉํ•ด์„œ commit ๋˜๋Š” push ์ „์— ์Šคํƒ€์ผ ํ™•์ธ์„ ์ž๋™ํ™”ํ•  ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
46+
47+
## Integrating with IDE
48+
49+
### VSCode
50+
51+
[Stylelint ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ][Stylelint]์„ ํ†ตํ•ด ํŒŒ์ผ ์ €์žฅ ์‹œ ์ผ๋ถ€ ์†์„ฑ์— ๋Œ€ํ•ด ์ž๋™์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
52+
53+
> ์Šคํƒ€์ผ๋ฆฐํŠธ๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์€ ํ”„๋กœ์ ํŠธ์—์„œ ์ž๋™ ์ˆ˜์ •์ด ๋˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”์— `.vscode/settings.json` ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
54+
55+
[Stylelint ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ][Stylelint]์„ค์น˜ ํ›„ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”์— `.vscode/settings.json` ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
56+
57+
```json
58+
{
59+
"css.validate": false,
60+
"less.validate": false,
61+
"scss.validate": false,
62+
"[css]": {
63+
"editor.formatOnSave": false,
64+
"editor.codeActionsOnSave": {
65+
"source.fixAll.stylelint": true
66+
}
67+
},
68+
"[scss]": {
69+
"editor.formatOnSave": false,
70+
"editor.codeActionsOnSave": {
71+
"source.fixAll.stylelint": true
72+
}
73+
},
74+
"stylelint.validate": ["css", "scss"]
75+
}
76+
```
77+
78+
์ด์ œ `*.{css,scss}` ํŒŒ์ผ ์ €์žฅ ์‹œ `stylelint --fix`๋ฅผ ์ž๋™์œผ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
79+
80+
[Stylelint]: https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
81+
82+
## Rules
83+
84+
- [at-rule](./src/rules/stylelint/at-rule/README.md)
85+
- [block](./src/rules/stylelint/block/README.md)
86+
- [color](./src/rules/stylelint/color/README.md)
87+
- [comment](./src/rules/stylelint/comment/README.md)
88+
- [declaration](./src/rules/stylelint/declaration/README.md)
89+
- [font](./src/rules/stylelint/font/README.md)
90+
- [function](./src/rules/stylelint/function/README.md)
91+
- [general](./src/rules/stylelint/general/README.md)
92+
- [length](./src/rules/stylelint/length/README.md)
93+
- [media-feature](./src/rules/stylelint/media-feature/README.md)
94+
- [property](./src/rules/stylelint/property/README.md)
95+
- [rule](./src/rules/stylelint/rule/README.md)
96+
- [selector](./src/rules/stylelint/selector/README.md)
97+
- [unit](./src/rules/stylelint/unit/README.md)
98+
- [stylelint-order](./src/rules/stylelint-order/README.md)
99+
- [stylelint-scss](./src/rules/stylelint-scss/README.md)

โ€Žpackages/stylelint-config/README.mdโ€Ž

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# @naverpay/stylelint-config
22

3-
๋„ค์ด๋ฒ„ํŽ˜์ด ์Šคํƒ€์ผ ๊ฐ€์ด๋“œ์— ๋งž๊ฒŒ stylelint-config ํŒจํ‚ค์ง€๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
3+
This package provides a stylelint-config compliant with the Naver Pay style guide.
44

55
## Install
66

7-
**stylelint**, **@naverpay/stylelint-config** ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.
7+
Install the **stylelint** and **@naverpay/stylelint-config** packages.
88

99
```bash
1010
npm install -D stylelint@^16 @naverpay/stylelint-config
1111
```
1212

1313
## Configure
1414

15-
`stylelint.config.mjs` ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. `defaultSeverity` ์˜ default ๊ฐ’์€ `warning` ์ž…๋‹ˆ๋‹ค.
15+
Create a `stylelint.config.mjs` file. The default value for `defaultSeverity` is `warning`.
1616

1717
```js
1818
/** @type {import('stylelint').Config} */
@@ -25,9 +25,11 @@ const config = {
2525
export default config
2626
```
2727

28+
> Only pure ESM is supported. Please create the file with an `.mjs` extension or add `"type": "module"` to your `package.json`.
29+
2830
## CLI
2931

30-
package.json์— ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ format ๊ฒ€์‚ฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
32+
You can add scripts to your `package.json` to perform format checks.
3133

3234
```jsonc
3335
// package.json
@@ -39,18 +41,18 @@ package.json์— ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ format ๊ฒ€์‚ฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ
3941
}
4042
```
4143

42-
> - `styelint@15.x` ๋ฒ„์ „ ๋ถ€ํ„ฐ prettier ๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋Š” ์ผ์„ prettier ์— ์œ„์ž„ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์—, stylelint ๊ฐ€ ๊ฒ€์‚ฌํ•˜๋Š” ํŒŒ์ผ์€ ๋ฐ˜๋“œ์‹œ `prettier`๋„ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. <https://github.com/stylelint/stylelint/blob/1c17fb87a2f16f041632e380dd0d600cb3532337/docs/migration-guide/to-15.md>
43-
> - [lefthook](https://github.com/evilmartians/lefthook)์„ ์‚ฌ์šฉํ•ด์„œ commit ๋˜๋Š” push ์ „์— ์Šคํƒ€์ผ ํ™•์ธ์„ ์ž๋™ํ™”ํ•  ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
44+
> - Since `stylelint@15.x`, formatting rules that Prettier can handle have been delegated to Prettier. Therefore, files linted by Stylelint must also be processed by Prettier. [https://github.com/stylelint/stylelint/blob/1c17fb87a2f16f041632e380dd0d600cb3532337/docs/migration-guide/to-15.md](https://github.com/stylelint/stylelint/blob/1c17fb87a2f16f041632e380dd0d600cb3532337/docs/migration-guide/to-15.md)
45+
> - It is recommended to automate style checks before commits or pushes using [lefthook](https://github.com/evilmartians/lefthook).
4446
4547
## Integrating with IDE
4648

4749
### VSCode
4850

49-
[Stylelint ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ][Stylelint]์„ ํ†ตํ•ด ํŒŒ์ผ ์ €์žฅ ์‹œ ์ผ๋ถ€ ์†์„ฑ์— ๋Œ€ํ•ด ์ž๋™์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
51+
With the [Stylelint extension][Stylelint], some properties can be automatically fixed on file save.
5052

51-
> ์Šคํƒ€์ผ๋ฆฐํŠธ๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์€ ํ”„๋กœ์ ํŠธ์—์„œ ์ž๋™ ์ˆ˜์ •์ด ๋˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”์— `.vscode/settings.json` ์ƒ์„ฑ
53+
> To prevent auto-fixing in projects not using Stylelint, create a `.vscode/settings.json` file in your project's root folder.
5254
53-
[Stylelint ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ][Stylelint]์„ค์น˜ ํ›„ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”์— `.vscode/settings.json` ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
55+
After installing the [Stylelint extension][Stylelint], create a `.vscode/settings.json` file in your project's root folder.
5456

5557
```json
5658
{
@@ -73,9 +75,9 @@ package.json์— ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ format ๊ฒ€์‚ฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ
7375
}
7476
```
7577

76-
์ด์ œ `*.{css,scss}` ํŒŒ์ผ ์ €์žฅ ์‹œ `stylelint --fix`๋ฅผ ์ž๋™์œผ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
78+
Now, `stylelint --fix` will run automatically when you save `*.{css,scss}` files.
7779

78-
[Stylelint]: https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
80+
[stylelint]: https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
7981

8082
## Rules
8183

0 commit comments

Comments
ย (0)