Skip to content

Commit fbe4f0a

Browse files
authored
chore: update biome to v2 (#1699)
* chore: update biome to v2 * fix: warnings
1 parent a093060 commit fbe4f0a

File tree

118 files changed

+444
-294
lines changed

Some content is hidden

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

118 files changed

+444
-294
lines changed

apps/vscode/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,26 @@
1515
},
1616
"description": "LaunchPad VS Code extension",
1717
"license": "SEE LICENSE IN LICENSE.txt",
18-
"keywords": ["launchpad", "launchdarkly", "design system", "design tokens"],
18+
"keywords": [
19+
"launchpad",
20+
"launchdarkly",
21+
"design system",
22+
"design tokens"
23+
],
1924
"engines": {
2025
"vscode": "^1.100.2"
2126
},
22-
"categories": ["Other"],
27+
"categories": [
28+
"Other"
29+
],
2330
"icon": "images/osmo.png",
2431
"galleryBanner": {
2532
"color": "#FFFFFF",
2633
"theme": "light"
2734
},
28-
"activationEvents": ["onLanguage:css"],
35+
"activationEvents": [
36+
"onLanguage:css"
37+
],
2938
"main": "dist/client.js",
3039
"scripts": {
3140
"vscode:prepublish": "esbuild ./src/client.ts ./src/server.ts --bundle --outdir=dist --external:vscode --format=cjs --platform=node",

apps/vscode/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import path from 'path';
2-
31
import type { ExtensionContext } from 'vscode';
42
import type { LanguageClientOptions, ServerOptions } from 'vscode-languageclient/node';
53

4+
import path from 'path';
5+
66
import { LanguageClient, TransportKind } from 'vscode-languageclient/node';
77

88
let client: LanguageClient;

apps/vscode/src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ import type {
99

1010
import tokens from '@launchpad-ui/tokens/dist/tokens.json';
1111
import { getCSSLanguageService } from 'vscode-css-languageservice/lib/esm/cssLanguageService';
12-
import { TextDocument } from 'vscode-languageserver-textdocument';
1312
import {
1413
Color,
1514
CompletionItemKind,
15+
createConnection,
1616
MarkupKind,
1717
ProposedFeatures,
1818
Range,
1919
TextDocumentSyncKind,
2020
TextDocuments,
21-
createConnection,
2221
} from 'vscode-languageserver/node';
22+
import { TextDocument } from 'vscode-languageserver-textdocument';
2323

2424
const cssLanguageService = getCSSLanguageService();
2525

@@ -163,7 +163,7 @@ connection.onDocumentColor(({ textDocument }) => {
163163
cssVarRegExp.lastIndex = 0;
164164
let match: RegExpExecArray | null;
165165

166-
// biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
166+
// biome-ignore lint/suspicious/noAssignInExpressions: ignore
167167
while ((match = cssVarRegExp.exec(text)) != null) {
168168
const offset = match.index;
169169
const length = match[0].length;

biome.json

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"files": {
4-
"ignore": [
5-
"dist/**",
6-
"playwright-report/**",
7-
"storybook-static/**",
8-
"test-results/**",
9-
"coverage/**",
10-
"build/**"
4+
"includes": [
5+
"**",
6+
"!**/dist/**",
7+
"!**/playwright-report/**",
8+
"!**/storybook-static/**",
9+
"!**/test-results/**",
10+
"!**/coverage/**",
11+
"!**/build/**"
1112
],
1213
"ignoreUnknown": true
1314
},
14-
"organizeImports": {
15-
"enabled": true
15+
"assist": {
16+
"actions": {
17+
"source": {
18+
"organizeImports": {
19+
"level": "on",
20+
"options": {
21+
"groups": [
22+
{ "type": true },
23+
":BLANK_LINE:",
24+
":NODE:",
25+
":BLANK_LINE:",
26+
":PACKAGE:",
27+
":BLANK_LINE:",
28+
":PATH:"
29+
]
30+
}
31+
}
32+
}
33+
}
1634
},
1735
"formatter": {
1836
"enabled": true,
@@ -34,14 +52,25 @@
3452
},
3553
"performance": {
3654
"noDelete": "off",
37-
"noReExportAll": "error"
55+
"noReExportAll": "error",
56+
"noNamespaceImport": "error"
3857
},
3958
"style": {
4059
"noDefaultExport": "error",
4160
"noNamespace": "error",
4261
"useFragmentSyntax": "error",
4362
"useNodejsImportProtocol": "off",
44-
"noNamespaceImport": "error"
63+
"noParameterAssign": "error",
64+
"useAsConstAssertion": "error",
65+
"useDefaultParameterLast": "error",
66+
"useEnumInitializers": "error",
67+
"useSelfClosingElements": "error",
68+
"useSingleVarDeclarator": "error",
69+
"noUnusedTemplateLiteral": "error",
70+
"useNumberNamespace": "error",
71+
"noInferrableTypes": "error",
72+
"noUselessElse": "error",
73+
"useImportType": "error"
4574
},
4675
"suspicious": {
4776
"noEmptyBlock": "off"
@@ -72,7 +101,7 @@
72101
},
73102
"overrides": [
74103
{
75-
"include": ["*.stories.tsx", "*.config.*", ".storybook"],
104+
"includes": ["**/*.stories.tsx", "**/*.config.*", "**/.storybook/**"],
76105
"linter": {
77106
"rules": {
78107
"style": {

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"homepage": "https://github.com/launchdarkly/launchpad-ui#readme",
3434
"devDependencies": {
35-
"@biomejs/biome": "1.9.1",
35+
"@biomejs/biome": "2.0.0-beta.5",
3636
"@changesets/changelog-github": "^0.5.0",
3737
"@changesets/cli": "^2.28.1",
3838
"@commitlint/cli": "^19.8.0",
@@ -102,5 +102,9 @@
102102
"vite": "npm:[email protected]"
103103
}
104104
},
105-
"browserslist": ["last 2 versions", "not dead", "not IE 11"]
105+
"browserslist": [
106+
"last 2 versions",
107+
"not dead",
108+
"not IE 11"
109+
]
106110
}

packages/box/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111
},
1212
"description": "A polymorphic React component with design token sprinkles.",
1313
"license": "Apache-2.0",
14-
"files": ["dist"],
14+
"files": [
15+
"dist"
16+
],
1517
"main": "dist/index.js",
1618
"module": "dist/index.es.js",
1719
"types": "dist/index.d.ts",
18-
"sideEffects": ["**/*.css"],
20+
"sideEffects": [
21+
"**/*.css"
22+
],
1923
"exports": {
2024
".": {
2125
"types": "./dist/index.d.ts",

packages/box/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export type { BoxProps } from './Box';
2+
23
export { Box } from './Box';

packages/box/src/styles/rainbow-sprinkles.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { vars } from '@launchpad-ui/vars';
33
import { flatten } from 'flat';
44
import { createRainbowSprinkles, defineProperties } from 'rainbow-sprinkles';
55

6+
// biome-ignore lint/correctness/noUnusedVariables: ignore
67
const { bg, border, fill, shadow, text, ...global } = vars.color;
78
const { text: typography, gradient } = vars;
89

packages/button/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111
},
1212
"description": "An element that triggers an action based on user interaction.",
1313
"license": "Apache-2.0",
14-
"files": ["dist"],
14+
"files": [
15+
"dist"
16+
],
1517
"main": "dist/index.js",
1618
"module": "dist/index.es.js",
1719
"types": "dist/index.d.ts",
18-
"sideEffects": ["**/*.css"],
20+
"sideEffects": [
21+
"**/*.css"
22+
],
1923
"exports": {
2024
".": {
2125
"types": "./dist/index.d.ts",

packages/button/src/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const ButtonComponent = forwardRef<HTMLButtonElement, ButtonProps>((props, ref)
9999
return cloneElement(
100100
children,
101101
undefined,
102-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
102+
// biome-ignore lint/suspicious/noExplicitAny: ignore
103103
getFinalChildren((children as ReactElement<any>).props.children),
104104
);
105105
}

0 commit comments

Comments
 (0)