Skip to content

Commit 147d30e

Browse files
fu050409wre232114
andauthored
chore: bump biome to v2 (#2234)
* chore: bump biome to v2 * chore(lint): apply code lints from biome v2 * chore: apply all lints * chore: remove module css from lint * fix: remove useless error expect * chore: add empty changeset * fix(types): apply suggestion from coderabbit * fix(types): fix ts check * chore(lint): fix code lint --------- Co-authored-by: brightwu <1521488775@qq.com>
1 parent 86c610f commit 147d30e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+477
-456
lines changed

.changeset/blue-jobs-lick.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.vscode/settings.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.inlineSuggest.showToolbar": "always",
44
"biome.enabled": true,
55
"editor.formatOnSave": true,
6-
"editor.defaultFormatter": "biomejs.biome",
6+
"editor.defaultFormatter": "esbenp.prettier-vscode",
77
"[typescript]": {
88
"editor.defaultFormatter": "biomejs.biome"
99
},
@@ -15,5 +15,33 @@
1515
},
1616
"[yaml]": {
1717
"editor.defaultFormatter": "esbenp.prettier-vscode"
18+
},
19+
"[javascript]": {
20+
"editor.defaultFormatter": "biomejs.biome"
21+
},
22+
"[javascriptreact]": {
23+
"editor.defaultFormatter": "biomejs.biome"
24+
},
25+
"[typescriptreact]": {
26+
"editor.defaultFormatter": "biomejs.biome"
27+
},
28+
"[json]": {
29+
"editor.defaultFormatter": "biomejs.biome"
30+
},
31+
"[jsonc]": {
32+
"editor.defaultFormatter": "biomejs.biome"
33+
},
34+
"[css]": {
35+
"editor.defaultFormatter": "biomejs.biome"
36+
},
37+
"[graphql]": {
38+
"editor.defaultFormatter": "biomejs.biome"
39+
},
40+
"typescript.tsdk": "node_modules/typescript/lib",
41+
"editor.formatOnPaste": true,
42+
"emmet.showExpandedAbbreviation": "never",
43+
"editor.codeActionsOnSave": {
44+
"source.fixAll.biome": "explicit",
45+
"source.organizeImports.biome": "explicit"
1846
}
19-
}
47+
}

biome.json

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
33
"vcs": {
44
"clientKind": "git",
55
"enabled": true,
66
"useIgnoreFile": true,
77
"defaultBranch": "main"
88
},
99
"files": {
10-
"ignore": [
11-
"**/node_modules/**",
12-
"crates/**",
13-
"*.vue",
14-
"tsconfig.base.json",
15-
"tsconfig.json",
16-
"cspell.json",
17-
"*.d.ts",
18-
"packages/core/cjs/**",
19-
"packages/runtime/**",
20-
"packages/runtime-plugin-import-meta/**",
21-
"packages/create-farm/templates/**",
22-
"packages/create-farm-plugin/templates/**",
23-
"rust-plugins/**",
24-
"js-plugins/vue/**",
25-
"e2e/**",
26-
"js-plugins/solid/**",
27-
"examples/**",
28-
"**/*.{js,mjs,cjs}"
10+
"includes": [
11+
"**",
12+
"!**/node_modules/**",
13+
"!**/crates/**",
14+
"!**/*.vue",
15+
"!**/tsconfig.base.json",
16+
"!**/tsconfig.json",
17+
"!**/cspell.json",
18+
"!**/*.d.ts",
19+
"!**/packages/core/cjs/**",
20+
"!**/packages/runtime/**",
21+
"!**/packages/runtime-plugin-import-meta/**",
22+
"!**/packages/create-farm/templates/**",
23+
"!**/packages/create-farm-plugin/templates/**",
24+
"!**/rust-plugins/**",
25+
"!**/js-plugins/vue/**",
26+
"!**/e2e/**",
27+
"!**/js-plugins/solid/**",
28+
"!**/examples/**",
29+
"!**/*.{js,mjs,cjs}"
2930
],
3031
"ignoreUnknown": true
3132
},
@@ -37,24 +38,19 @@
3738
"lineEnding": "lf",
3839
"lineWidth": 80,
3940
"attributePosition": "auto",
40-
"include": ["**/*.ts"],
41-
"ignore": ["node_modules", "dist"]
42-
},
43-
"organizeImports": {
44-
"enabled": true,
45-
"include": ["./**/*.js", "./**/*.ts", "./**/*.mjs"]
41+
"includes": ["**/*.ts", "!**/node_modules", "!**/dist"]
4642
},
43+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
4744
"linter": {
4845
"enabled": true,
4946
"rules": {
5047
"recommended": false,
5148
"complexity": {
5249
"noBannedTypes": "off",
5350
"noExtraBooleanCast": "error",
54-
"noMultipleSpacesInRegularExpressionLiterals": "error",
5551
"noUselessTypeConstraint": "error",
56-
"noWith": "error",
57-
"noUselessCatch": "off"
52+
"noUselessCatch": "off",
53+
"noAdjacentSpacesInRegex": "error"
5854
},
5955
"correctness": {
6056
"noConstAssign": "error",
@@ -64,7 +60,6 @@
6460
"noGlobalObjectCalls": "error",
6561
"noInnerDeclarations": "error",
6662
"noInvalidConstructorSuper": "error",
67-
"noNewSymbol": "error",
6863
"noNonoctalDecimalEscape": "error",
6964
"noPrecisionLoss": "error",
7065
"noSelfAssign": "error",
@@ -79,7 +74,9 @@
7974
"noUnusedVariables": "off",
8075
"useIsNan": "error",
8176
"useValidForDirection": "error",
82-
"useYield": "error"
77+
"useYield": "error",
78+
"noInvalidBuiltinInstantiation": "error",
79+
"useValidTypeof": "error"
8380
},
8481
"style": {
8582
"noInferrableTypes": "error",
@@ -113,17 +110,18 @@
113110
"noUnsafeNegation": "error",
114111
"useGetterReturn": "error",
115112
"useNamespaceKeyword": "error",
116-
"useValidTypeof": "error"
113+
"noWith": "error"
117114
}
118115
},
119-
"ignore": [
120-
"**/binding/**",
121-
"**/templates/**",
122-
"**/dist/**",
123-
"**/docs/**",
124-
"**/node_modules/**",
125-
"**/*.config.js",
126-
"**/*.config.ts"
116+
"includes": [
117+
"**",
118+
"!**/binding/**",
119+
"!**/templates/**",
120+
"!**/dist/**",
121+
"!**/docs/**",
122+
"!**/node_modules/**",
123+
"!**/*.config.js",
124+
"!**/*.config.ts"
127125
]
128126
},
129127
"javascript": {

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@
291291
"typedotenv",
292292
"typeofs",
293293
"Ujanq",
294+
"ultracite",
294295
"unioned",
295296
"unocss",
296297
"unplugin",

docs/biome.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3+
"files": {
4+
"includes": ["!**/index.module.css"]
5+
},
6+
"extends": "//"
7+
}

docs/scripts/translations.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import path from 'path';
2-
import fs from 'fs/promises';
3-
41
import crowdin, {
52
Credentials,
63
TranslationStatus
74
} from '@crowdin/crowdin-api-client';
5+
import fs from 'fs/promises';
6+
import path from 'path';
87

98
const token =
109
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJ3UUVxdmhVM3ZMT2EyWGljbVV5VCIsImp0aSI6IjYxZjI5YjkyYmU4YTUwMjk5MWEzMmM0ZWRmMDQ3ZTk1NjFhZDIyMzk2OGE1MmQ4MGFlNzM1YmY1YWVjNzZiMDVlODk5YjEzMWMzN2MxYWY2IiwiaWF0IjoxNjkwMjg5MTE2LjY2NDAxOCwibmJmIjoxNjkwMjg5MTE2LjY2NDAyMSwiZXhwIjoxNzIxODI1MTE2LjU1NjU4Miwic3ViIjoiMTU5MzQ5MDMiLCJzY29wZXMiOlsicHJvamVjdCJdLCJkb21haW4iOm51bGwsImFzc29jaWF0aW9ucyI6WyIqIl0sInNlc3Npb24iOjB9.rG2dtUOUI6y4YzlL4_AxfHSGhH8XsAQDBIPxb-hts56kOWnaACVHU9-Y2e7ABzaAmEsdxJ4Wl6kByFAF1DJ-n-ga02PVPW1EV8RulXZwram5lofZUjanq8OBuBMnOptJsxhmf962_t8G7lDvN0zYcOuddKg_sBcmEC1QS8ngF0OwDrQhOyzyAavciUIbwZERsLKoXyMj1EDWEtJ8UWePFcCiQUk5pffnOXR-lVgudO9JgK4breoKB6cTKp_J4mj8eFUmEOwgYhciNIxTYhmMrv43l9-sgPQA2NBct5p0ifHrPtktl5uEZYrjMQqwGhVDSVA5OakyYVdp2MsT2dTgBBqd9HY7Cuph9A5JDEL3ZwEW8Exw3qWcBDUKv7-IONcRSrbUIyTzw0ZYBSz5lE--33vsdWEOuZCDaU16pHOjCfudsiDjQI5RFVLYsMo05Qkf0zzse3WYNybxx2YrO2JiYRdjgGzN-inUoMek7phvjbFKq30XCI2CZDa3XrZjwgCF3RTAd-hoFIsi65u1vj-L554xvIU6NITHVklunZcIcZjoRFeDN1uw5pXcRMRcfchjBpSXNQRucdkRN-P2ay5dZS1M8tGlvygJtjc5pFgDGV51Zx_NFVGv75xrQ_UivKE8UIljwt5Aci_eHDE_f8keMANrATdSzMmXlyRUhh-8aWI';

docs/src/components/Benchmark/ProgressBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { useState, useEffect } from "react";
2-
import { useSpring, animated } from "@react-spring/web";
1+
import { animated, useSpring } from "@react-spring/web";
2+
import React, { useEffect, useState } from "react";
33
import styles from "./index.module.css";
44

55
export function formatTime(time: number, totalTime: number) {

docs/src/components/Benchmark/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { ProgressBar } from "./ProgressBar";
2-
import farmCard from "../Card";
3-
import { useInView } from "react-intersection-observer";
4-
import styles from "./index.module.css";
5-
import Translate from "@docusaurus/Translate";
61
import Link from "@docusaurus/Link";
7-
import React, { useState, useMemo } from "react";
2+
import Translate from "@docusaurus/Translate";
83
import clsx from "clsx";
4+
import React, { useMemo, useState } from "react";
5+
import { useInView } from "react-intersection-observer";
6+
import farmCard from "../Card";
97
import ShinyTextEx from "../MagicUi/shiny-text";
8+
import styles from "./index.module.css";
9+
import { ProgressBar } from "./ProgressBar";
10+
1011
const BENCHMARK_DATA = {
1112
ColdStart: [
1213
{

docs/src/components/MagicUi/animated-beam.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3-
import { RefObject, useEffect, useId, useState } from "react";
43
import { motion } from "framer-motion";
4+
import { RefObject, useEffect, useId, useState } from "react";
55

66
import { cn } from "../../lib/utils";
77

docs/src/components/MagicUi/animated-shiny-text.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { cn } from "../../lib/utils";
2-
import { ReactNode } from "react";
3-
import React from "react";
41
import { ChevronRight, Github } from "lucide-react";
2+
import React, { ReactNode } from "react";
3+
import { cn } from "../../lib/utils";
54

65
export function AnimatedGradientText({
76
children,

0 commit comments

Comments
 (0)