Skip to content

Commit 9918450

Browse files
committed
feat(package): ✨ prettier
- prettier.config.js配置文件 - @jsxiaosi/eslint-config 支持外部prettier配置文件
1 parent e43e018 commit 9918450

File tree

8 files changed

+3763
-2268
lines changed

8 files changed

+3763
-2268
lines changed

eslint.config.mjs renamed to eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ import jsxiaosi from '@jsxiaosi/eslint-config';
33
export default jsxiaosi({
44
typescript: true,
55
react: true,
6-
prettier: true,
6+
prettier: {
7+
usePrettierrc: true,
8+
},
79
});

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"staging": "tsc && vite build --mode staging",
1616
"preview": "vite preview",
1717
"lint:eslint": "eslint \"{src,mock,build}/**/*.{ts,js,tsx,jsx}\" package.json --fix",
18+
"lint:prettier": "prettier --write .",
1819
"lint:staged": "lint-staged",
1920
"log": "conventional-changelog -p cmyr-config -i CHANGELOG.md -s -r 0",
2021
"tsc": "tsc --noEmit --skipLibCheck",
@@ -48,8 +49,9 @@
4849
"devDependencies": {
4950
"@emotion/babel-plugin": "^11.12.0",
5051
"@eslint-react/eslint-plugin": "^1.14.3",
51-
"@jsxiaosi/commitlint-config": "^1.0.2",
52-
"@jsxiaosi/eslint-config": "^1.0.2",
52+
"@jsxiaosi/commitlint-config": "^1.0.5",
53+
"@jsxiaosi/eslint-config": "^1.0.5",
54+
"@jsxiaosi/eslint-config-prettier": "^1.0.5",
5355
"@types/crypto-js": "^4.2.2",
5456
"@types/lodash-es": "^4.17.12",
5557
"@types/react": "^18.3.3",
@@ -92,7 +94,18 @@
9294
},
9395
"lint-staged": {
9496
"{src,mock,build}/**/*.{ts,js,tsx,jsx}": [
97+
"eslint --fix",
98+
"prettier --write"
99+
],
100+
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
95101
"eslint --fix"
102+
],
103+
"package.json": [
104+
"prettier --write"
105+
],
106+
"*.md": [
107+
"eslint --fix",
108+
"prettier --write"
96109
]
97110
}
98111
}

pnpm-lock.yaml

Lines changed: 3735 additions & 2261 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prettier.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import prettierConfig from '@jsxiaosi/eslint-config-prettier';
2+
3+
export default {
4+
...prettierConfig,
5+
};

src/components/AppTheme/index.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
width: 16px;
1616
height: 16px;
1717
border-radius: 50%;
18-
transition: transform 0.5s, background-color 0.5s;
18+
transition:
19+
transform 0.5s,
20+
background-color 0.5s;
1921
will-change: transform;
2022
}
2123
}

src/layout/components/Sidebar/SidebarInline/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.sidebar {
2-
32
.ant-menu-inline-collapsed {
43
width: 54px;
54
}

types/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare interface ViteEnv {
44
readonly VITE_ENV: string;
5-
readonly VITE_KEY_ALIVE: 'TRUE' | 'FALSE'
5+
readonly VITE_KEY_ALIVE: 'TRUE' | 'FALSE';
66
}
77

88
interface ImportMetaEnv extends ViteEnv {

0 commit comments

Comments
 (0)