From 47178d66a156454dbf91e4f3702edef4b9f38f29 Mon Sep 17 00:00:00 2001 From: donniean Date: Fri, 19 Jul 2024 17:14:06 +0800 Subject: [PATCH] chore: update template Signed-off-by: donniean --- .prettierrc | 30 ------------------------------ package.json | 2 +- prettier.config.cjs | 6 ++++++ template/editorconfig | 20 ++++++-------------- template/package.json | 14 ++++++++++---- template/prettierignore | 6 ++++-- yarn.lock | 10 +++++----- 7 files changed, 32 insertions(+), 56 deletions(-) delete mode 100644 .prettierrc create mode 100644 prettier.config.cjs diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b2fb58a..0000000 --- a/.prettierrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "arrowParens": "avoid", - "tabWidth": 2, - "printWidth": 100, - "singleQuote": true, - "trailingComma": "all", - "bracketSpacing": true, - "semi": true, - "useTabs": false, - "parser": "typescript", - "jsxBracketSameLine": false, - "overrides": [ - { - "files": "*.jsx?", - "options": { "parser": "babel" } - }, - { - "files": "*.scss", - "options": { "parser": "scss" } - }, - { - "files": "*.json", - "options": { "parser": "json" } - }, - { - "files": "*.md", - "options": { "parser": "markdown" } - } - ] -} diff --git a/package.json b/package.json index f9047c7..b4cc699 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^6.0.0", "eslint-plugin-react": "^7.30.0", - "prettier": "^2.6.2", + "prettier": "^3.3.3", "typescript": "4.6.3" } } diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000..ab85baa --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + printWidth: 100, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'avoid', +}; diff --git a/template/editorconfig b/template/editorconfig index cbdac16..47c5c7c 100644 --- a/template/editorconfig +++ b/template/editorconfig @@ -1,24 +1,16 @@ root = true -[*.jsx?] -charset = utf-8 +[*] indent_style = space indent_size = 2 +tab_width = 2 end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.tsx?] charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false [Makefile] indent_style = tab - -[*.yaml] -indent_style = space -indent_size = 2 diff --git a/template/package.json b/template/package.json index ea00a2a..bbbe6bc 100644 --- a/template/package.json +++ b/template/package.json @@ -4,7 +4,9 @@ "private": true, "license": "MIT", "main": "index.js", - "workspaces": ["extensions/*"], + "workspaces": [ + "extensions/*" + ], "scripts": { "build:dll": "ksc build:dll", "build:ext": "ksc build:ext", @@ -13,7 +15,11 @@ "dev:client": "ksc dev -u true", "dev:server": "ksc-server" }, - "browserslist": ["> 1%", "last 2 versions", "not ie <= 8"], + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ], "dependencies": { "@ks-console/appstore": "^4.1.1", "@ks-console/bootstrap": "^4.1.1", @@ -92,7 +98,7 @@ "dayjs": "^1.10.7", "eslint": "^7.32.0", "eslint-config-airbnb-typescript": "^14.0.1", - "eslint-config-kubesphere": "^1.0.0", + "eslint-config-kubesphere": "^1.2.1", "eslint-config-prettier": "^7.2.0", "eslint-friendly-formatter": "^4.0.1", "eslint-import-resolver-webpack": "^0.13.1", @@ -117,7 +123,7 @@ "no-case": "3.0.4", "nodemon": "^2.0.7", "postcss-loader": "^3.0.0", - "prettier": "^2.4.1", + "prettier": "^3.3.3", "prop-types": "^15.7.2", "qs": "^6.10.1", "react": "^17.0.2", diff --git a/template/prettierignore b/template/prettierignore index 386f24a..c510410 100644 --- a/template/prettierignore +++ b/template/prettierignore @@ -1,3 +1,5 @@ -node_modules +**/node_modules/ +**/dist/ +**/v3dist/ yarn.lock -package-lock.json \ No newline at end of file +package-lock.json diff --git a/yarn.lock b/yarn.lock index c3f62ab..14905c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2842,16 +2842,16 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" - integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== - prettier@^2.7.1: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== + progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"