You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> -`[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`를 자동으로 실행합니다.
`.stylelintrc` 파일을 생성합니다. `defaultSeverity`의 default 값은 `warning` 입니다.
15
+
Create a `stylelint.config.mjs` file. The default value for `defaultSeverity`is `warning`.
16
16
17
-
```json
18
-
{
19
-
"extends": ["@naverpay/stylelint-config"],
20
-
"defaultSeverity": "error"
17
+
```js
18
+
/**@type{import('stylelint').Config}*/
19
+
constconfig= {
20
+
extends: ['@naverpay/stylelint-config'],
21
+
defaultSeverity:'error',
22
+
rules: {},
21
23
}
24
+
25
+
exportdefaultconfig
22
26
```
23
27
28
+
> Only pure ESM is supported. Please create the file with an `.mjs` extension or add `"type": "module"` to your `package.json`.
29
+
24
30
## CLI
25
31
26
-
package.json에 스크립트를 추가하여 format 검사를 할 수 있습니다.
32
+
You can add scripts to your `package.json` to perform format checks.
27
33
28
34
```jsonc
29
35
// package.json
@@ -35,17 +41,18 @@ package.json에 스크립트를 추가하여 format 검사를 할 수 있습니
35
41
}
36
42
```
37
43
38
-
> [lefthook](https://github.com/evilmartians/lefthook)을 사용해서 commit 또는 push 전에 스타일 확인을 자동화할 것을 권장합니다.
44
+
> - Since `[email protected]`, 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).
39
46
40
47
## Integrating with IDE
41
48
42
49
### VSCode
43
50
44
-
[Stylelint 확장 프로그램][Stylelint]을 통해 파일 저장 시 일부 속성에 대해 자동으로 수정할 수 있습니다.
51
+
With the [Stylelint extension][Stylelint], some properties can be automatically fixed on file save.
45
52
46
-
> 스타일린트가 적용되지 않은 프로젝트에서 자동 수정이 되는 것을 방지하기 위해 프로젝트 루트 폴더에 `.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.
47
54
48
-
[Stylelint 확장 프로그램][Stylelint]설치 후 프로젝트 루트 폴더에 `.vscode/settings.json`을 생성합니다.
55
+
After installing the [Stylelint extension][Stylelint], create a `.vscode/settings.json`file in your project's root folder.
49
56
50
57
```json
51
58
{
@@ -68,9 +75,9 @@ package.json에 스크립트를 추가하여 format 검사를 할 수 있습니
68
75
}
69
76
```
70
77
71
-
이제 `*.{css,scss}` 파일 저장 시 `stylelint --fix`를 자동으로 실행합니다.
78
+
Now, `stylelint --fix` will run automatically when you save `*.{css,scss}` files.
0 commit comments