Skip to content

Commit

Permalink
[Feature] - stylelint 설정 (#51)
Browse files Browse the repository at this point in the history
* chore: stylelint 관련 의존성 추가

* chore: stylelint 규칙 stylelintrc.json에 추가

* chore: vscode 관련 설정 추가
  • Loading branch information
jinyoung234 authored Jul 18, 2024
1 parent 88b5338 commit eae8ec9
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["stylelint.vscode-stylelint"]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
},
"stylelint.validate": ["typescriptreact", "typescript"],
"stylelint.configFile": "./frontend/.stylelintrc.json",
"stylelint.packageManager": "yarn"
}
82 changes: 82 additions & 0 deletions frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-order"],
"customSyntax": "postcss-styled-syntax",
"rules": {
"declaration-empty-line-before": [
"always",
{
"ignore": ["first-nested", "after-comment", "after-declaration", "inside-single-line-block"]
}
],
"order/properties-order": [
{
"groupName": "Layout",
"noEmptyLineBetween": true,
"properties": [
"display",
"visibility",
"overflow",
"float",
"clear",
"position",
"top",
"right",
"bottom",
"left",
"z-index"
]
},
{
"groupName": "Box",
"emptyLineBefore": "always",
"noEmptyLineBetween": true,
"properties": [
"width",
"height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"border"
]
},
{
"groupName": "Background",
"emptyLineBefore": "always",
"noEmptyLineBetween": true,
"properties": ["background-color"]
},
{
"groupName": "Font",
"emptyLineBefore": "always",
"noEmptyLineBetween": true,
"properties": [
"color",
"font-style",
"font-weight",
"font-size",
"line-height",
"letter-spacing",
"text-align",
"text-indent",
"vertical-align",
"white-space"
]
},
{
"groupName": "Animation",
"emptyLineBefore": "always",
"noEmptyLineBetween": true,
"properties": ["animation"]
}
]
},
"order/order": ["custom-properties", "declarations"]
}
7 changes: 6 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"repository": "https://github.com/woowacourse-teams/2024-touroot",
"scripts": {
"dev": "webpack serve --config webpack.common.js",
"build": "NODE_ENV=production webpack --config webpack.common.js"
"build": "NODE_ENV=production webpack --config webpack.common.js",
"lint:styled": "stylelint './src/**/*.styled.ts' --fix"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand All @@ -27,7 +28,11 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.8",
"html-webpack-plugin": "^5.6.0",
"postcss-styled-syntax": "^0.6.4",
"prettier": "^3.3.2",
"stylelint": "16.6.1",
"stylelint-config-standard": "^36.0.1",
"stylelint-order": "^6.0.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.3",
"webpack": "^5.92.1",
Expand Down

0 comments on commit eae8ec9

Please sign in to comment.