Skip to content

Commit bb81bab

Browse files
authored
Enable HTML in Biome and fix Biome plugin in Trunk Check (#874)
1 parent 83321c5 commit bb81bab

7 files changed

Lines changed: 166 additions & 51 deletions

File tree

.trunk/trunk.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,39 @@ lint:
5050
parse_regex: ${semver}
5151
run: yamlfmt -version
5252
known_good_version: 0.16.0
53+
- name: biome
54+
files:
55+
- astro
56+
- css
57+
- graphql
58+
- html
59+
- javascript
60+
- json
61+
- sass
62+
- typescript
63+
commands:
64+
- output: regex
65+
success_codes:
66+
- 0
67+
- 1
68+
batch: true
69+
cache_results: true
70+
name: lint
71+
parse_regex: " *(?P<path>.*?):(?P<line>\\d+):(?P<col>\\d+) (?P<code>[^ ]+)(?:[^×]*\\n).*× (?P<message>.*)\\n"
72+
read_output_from: stderr
73+
run: biome check ${target}
74+
run_from: ${parent}
75+
- output: rewrite
76+
success_codes:
77+
- 0
78+
- 1
79+
batch: true
80+
cache_results: true
81+
formatter: true
82+
in_place: true
83+
name: fmt
84+
run: biome check --fix "${target}"
85+
run_from: ${parent}
5386
enabled:
5487
- actionlint@1.7.7
5588
- biome@2.0.0! # datasource=npm depName=@biomejs/biome

biome.jsonc

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3-
"vcs": {
4-
"enabled": true,
5-
"clientKind": "git",
6-
"useIgnoreFile": true
7-
},
8-
"files": {
9-
"includes": ["**", "!**/.trunk/**", "!**/build/**", "!**/dist/**", "!**/package.json"]
10-
},
11-
"formatter": {
12-
"attributePosition": "auto",
13-
"bracketSpacing": true,
14-
"enabled": true,
15-
"formatWithErrors": false,
16-
"indentStyle": "space",
17-
"indentWidth": 2,
18-
"lineEnding": "lf",
19-
"lineWidth": 120,
20-
"useEditorconfig": true
21-
},
223
"assist": {
234
"actions": {
245
"source": {
256
"organizeImports": {
267
"level": "on",
278
"options": {
289
"groups": [
29-
{ "type": false },
10+
{
11+
"type": false
12+
},
3013
":NODE:",
3114
":BLANK_LINE:",
3215
"@freelensapp/**",
@@ -40,27 +23,63 @@
4023
}
4124
}
4225
},
26+
"files": {
27+
"includes": ["**", "!**/.trunk/**", "!**/build/**", "!**/dist/**", "!**/package.json"]
28+
},
29+
"formatter": {
30+
"attributePosition": "auto",
31+
"bracketSpacing": true,
32+
"enabled": true,
33+
"formatWithErrors": false,
34+
"indentStyle": "space",
35+
"indentWidth": 2,
36+
"lineEnding": "lf",
37+
"lineWidth": 120,
38+
"useEditorconfig": true
39+
},
40+
"html": {
41+
"formatter": {
42+
"enabled": true
43+
}
44+
},
45+
"javascript": {
46+
"formatter": {
47+
"arrowParentheses": "always",
48+
"attributePosition": "auto",
49+
"bracketSameLine": false,
50+
"bracketSpacing": true,
51+
"jsxQuoteStyle": "double",
52+
"quoteProperties": "asNeeded",
53+
"quoteStyle": "double",
54+
"semicolons": "always",
55+
"trailingCommas": "all"
56+
}
57+
},
4358
"linter": {
4459
"enabled": true,
4560
"rules": {
4661
"a11y": {
4762
"noRedundantRoles": "off"
4863
},
4964
"complexity": {
50-
"noBannedTypes": "off", // should be error later
65+
// should be error later
66+
"noBannedTypes": "off",
5167
"noUselessConstructor": "off",
5268
"noUselessThisAlias": "error",
5369
"noUselessTypeConstraint": "error"
5470
},
5571
"correctness": {
5672
"noInvalidUseBeforeDeclaration": "error",
57-
"noUnusedVariables": "off", // should be error later
73+
// should be error later
74+
"noUnusedVariables": "off",
5875
"useExhaustiveDependencies": "off"
5976
},
6077
"recommended": false,
6178
"style": {
6279
"noNamespace": "error",
63-
"noParameterAssign": "off", // should be error later
80+
// should be error later
81+
"noParameterAssign": "off",
82+
"useArrayLiterals": "off",
6483
"useAsConstAssertion": "error",
6584
"useBlockStatements": "off",
6685
"useNamingConvention": {
@@ -69,30 +88,24 @@
6988
"strictCase": false
7089
}
7190
},
72-
"useTemplate": "off", // should be error later
73-
"useArrayLiterals": "off"
91+
// should be error later
92+
"useTemplate": "off"
7493
},
7594
"suspicious": {
7695
"noEmptyInterface": "off",
77-
"noExplicitAny": "off", // should be error later
96+
// should be error later
97+
"noExplicitAny": "off",
7898
"noExtraNonNullAssertion": "error",
7999
"noMisleadingInstantiator": "error",
80-
"noUnsafeDeclarationMerging": "off", // should be error later
100+
// should be error later
101+
"noUnsafeDeclarationMerging": "off",
81102
"useNamespaceKeyword": "error"
82103
}
83104
}
84105
},
85-
"javascript": {
86-
"formatter": {
87-
"arrowParentheses": "always",
88-
"attributePosition": "auto",
89-
"bracketSameLine": false,
90-
"bracketSpacing": true,
91-
"jsxQuoteStyle": "double",
92-
"quoteProperties": "asNeeded",
93-
"quoteStyle": "double",
94-
"semicolons": "always",
95-
"trailingCommas": "all"
96-
}
106+
"vcs": {
107+
"clientKind": "git",
108+
"enabled": true,
109+
"useIgnoreFile": true
97110
}
98111
}

freelens/static/splash.html

Lines changed: 38 additions & 4 deletions
Large diffs are not rendered by default.

packages/core/src/renderer/components/events/events.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ enum columnId {
4747
lastSeen = "last-seen",
4848
}
4949

50-
export interface EventsProps
51-
extends Partial<KubeObjectListLayoutProps<KubeEvent, KubeEventApi, KubeEventData>> {
50+
export interface EventsProps extends Partial<KubeObjectListLayoutProps<KubeEvent, KubeEventApi, KubeEventData>> {
5251
className?: IClassName;
5352
compact?: boolean;
5453
compactLimit?: number;

packages/core/src/renderer/components/item-object-list/list-layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ import type { SearchInputUrlProps } from "../input";
3636
import type { TableProps, TableRowProps, TableSortCallbacks } from "../table";
3737
import type { PageFiltersStore } from "./page-filters/store";
3838

39-
export type ListLayoutSearchFilter<I extends ItemObject> = (item: I) => SingleOrMany<string | number | undefined | null>;
39+
export type ListLayoutSearchFilter<I extends ItemObject> = (
40+
item: I,
41+
) => SingleOrMany<string | number | undefined | null>;
4042
export type ListLayoutSearchFilters<I extends ItemObject> = Record<string, ListLayoutSearchFilter<I>>;
4143
export type ListLayoutItemsFilter<I extends ItemObject> = (items: I[]) => I[];
4244
export type ListLayoutItemsFilters<I extends ItemObject> = Record<string, ListLayoutItemsFilter<I>>;

packages/core/src/renderer/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
4+
<meta charset="UTF-8" >
55
</head>
66
<body>
77
<div id="app"></div>

0 commit comments

Comments
 (0)