From 2c41be646f541c7abc191eea6ca21d8435529971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=89=E1=85=A9=E1=86=AB=E1=84=8C=E1=85=B5=E1=86=AB?= =?UTF-8?q?=E1=84=8B=E1=85=A7=E1=86=BC?= Date: Wed, 17 Jul 2024 18:43:53 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20stylelint=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 3bf3b8bc..040a9d7e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", @@ -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", From 6755a84d53dd932955803ef6763bcc5150ca7386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=89=E1=85=A9=E1=86=AB=E1=84=8C=E1=85=B5=E1=86=AB?= =?UTF-8?q?=E1=84=8B=E1=85=A7=E1=86=BC?= Date: Wed, 17 Jul 2024 18:44:28 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20stylelint=20=EA=B7=9C=EC=B9=99=20s?= =?UTF-8?q?tylelintrc.json=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.stylelintrc.json | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 frontend/.stylelintrc.json diff --git a/frontend/.stylelintrc.json b/frontend/.stylelintrc.json new file mode 100644 index 00000000..54549255 --- /dev/null +++ b/frontend/.stylelintrc.json @@ -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"] +} From 3529be1b2b9753f23dbf9c3329e21496117e8309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=89=E1=85=A9=E1=86=AB=E1=84=8C=E1=85=B5=E1=86=AB?= =?UTF-8?q?=E1=84=8B=E1=85=A7=E1=86=BC?= Date: Wed, 17 Jul 2024 18:44:53 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20vscode=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 3 +++ .vscode/settings.json | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..494eea3e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["stylelint.vscode-stylelint"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..198eace8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.stylelint": "explicit" + }, + "stylelint.validate": ["typescriptreact", "typescript"], + "stylelint.configFile": "./frontend/.stylelintrc.json", + "stylelint.packageManager": "yarn" +}