Skip to content

Commit f1317fa

Browse files
committed
chore: clean up code formatting and update .gitignore
1 parent 4f8b770 commit f1317fa

29 files changed

Lines changed: 345 additions & 254 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
# Create Biome
27+
.biomeignore

biome.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "space",
14+
"lineWidth": 100,
15+
"indentWidth": 2
16+
},
17+
"javascript": {
18+
"jsxRuntime": "reactClassic",
19+
"formatter": {
20+
"quoteStyle": "single"
21+
}
22+
},
23+
"assist": {
24+
"actions": {
25+
"source": {
26+
"organizeImports": "off"
27+
}
28+
}
29+
},
30+
"linter": {
31+
"rules": {
32+
"style": {
33+
"useNodejsImportProtocol": "off",
34+
"noNonNullAssertion": "off"
35+
},
36+
"complexity": {
37+
"useDateNow": "off",
38+
"noImportantStyles": "off",
39+
"useOptionalChain": "off"
40+
},
41+
"correctness": {
42+
"useUniqueElementIds": "off",
43+
"useExhaustiveDependencies": "off"
44+
},
45+
"suspicious": {
46+
"noTsIgnore": "off",
47+
"noExplicitAny": "off",
48+
"noArrayIndexKey": "off",
49+
"noConfusingVoidType": "off",
50+
"noNonNullAssertedOptionalChain": "off",
51+
"noThenProperty": "off",
52+
"noTemplateCurlyInString": "off",
53+
"useIterableCallbackReturn": "off"
54+
},
55+
"performance": {
56+
"noAccumulatingSpread": "off",
57+
"noDynamicNamespaceImportAccess": "off"
58+
},
59+
"a11y": {
60+
"noLabelWithoutControl": "off",
61+
"useFocusableInteractive": "off",
62+
"useKeyWithClickEvents": "off",
63+
"useSemanticElements": "off",
64+
"noStaticElementInteractions": "off",
65+
"useAriaPropsSupportedByRole": "off",
66+
"useAriaPropsForRole": "off"
67+
}
68+
}
69+
},
70+
"css": {
71+
"formatter": {
72+
"quoteStyle": "single"
73+
}
74+
}
75+
}

eslint.config.mjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"type": "module",
1919
"scripts": {
2020
"build": "tsc && vite build",
21-
"ci:eslint": "eslint -f json src -o ./.ci/eslint.json",
2221
"dev": "vite",
23-
"lint": "eslint .",
24-
"lint:fix": "eslint --fix .",
25-
"preview": "vite preview"
22+
"lint": "biome check .",
23+
"lint:fix": "biome format --write . && biome check --write .",
24+
"preview": "vite preview",
25+
"lint:ci": "biome check ."
2626
},
2727
"dependencies": {
2828
"html2canvas": "^1.4.1",
@@ -35,12 +35,10 @@
3535
"redux": "^4.2.1"
3636
},
3737
"devDependencies": {
38+
"@biomejs/biome": "^2.3.8",
3839
"@types/react": "^18.2.15",
3940
"@types/react-dom": "^18.2.7",
4041
"@vitejs/plugin-react": "^4.0.3",
41-
"eslint": "^9.31.0",
42-
"eslint-config-ali": "^16.3.0",
43-
"eslint-plugin-react-refresh": "^0.4.3",
4442
"less": "^4.2.0",
4543
"typescript": "^5.0.2",
4644
"vite": "^4.4.5"

pnpm-lock.yaml

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

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ export default function App() {
1212
</main>
1313
);
1414
}
15-

src/components/action-bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function ActionBar(props: IProps) {
3232
dispatch({ type: actionType });
3333
break;
3434
default:
35-
// 默认处理
35+
// 默认处理
3636
}
3737
};
3838

src/components/color-list-item/index.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SETTINGS } from '@constants';
2-
import { AvatarOption } from '@types';
2+
import type { AvatarOption } from '@types';
33

44
interface IProps {
55
avatarOption: AvatarOption;
@@ -26,15 +26,8 @@ export default function ColorListItem(props: IProps) {
2626
return (
2727
<ul className="color-list">
2828
{SETTINGS.backgroundColor.map((bgColor: string) => (
29-
<li
30-
key={bgColor}
31-
className="color-list__item"
32-
onClick={() => onSwitchBgColor(bgColor)}
33-
>
34-
<div
35-
style={{ background: bgColor }}
36-
className={`bg-color ${getBgColorClass(bgColor)}`}
37-
/>
29+
<li key={bgColor} className="color-list__item" onClick={() => onSwitchBgColor(bgColor)}>
30+
<div style={{ background: bgColor }} className={`bg-color ${getBgColorClass(bgColor)}`} />
3831
</li>
3932
))}
4033
</ul>
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import PerfectScrollbar from '../perfect-scrollbar';
2-
import { AvatarOption } from '@types';
2+
import type { AvatarOption } from '@types';
33
import './style.less';
44

55
interface IProps {
@@ -8,7 +8,5 @@ interface IProps {
88
}
99
export default function Configurator(props: IProps) {
1010
const { avatarOption, setAvatarOption } = props;
11-
return (
12-
<PerfectScrollbar avatarOption={avatarOption} setAvatarOption={setAvatarOption} />
13-
);
11+
return <PerfectScrollbar avatarOption={avatarOption} setAvatarOption={setAvatarOption} />;
1412
}

0 commit comments

Comments
 (0)