Skip to content

Commit

Permalink
chore: upgrade to biome 1.9.4 (#8616)
Browse files Browse the repository at this point in the history
The two lints being turned off are new for 1.9.x and caused a massive
diff inside frontend if activated. To reduce impact, these were turned off for
the merge. We might want to look at turning them back on once we're
ready to have a semantic / a11y refactor of our frontend.
  • Loading branch information
chriswk authored Oct 31, 2024
1 parent 7f5d273 commit 8d4e3ef
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 102 deletions.
8 changes: 6 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useSemanticElements": "off"
},
"correctness": {
"noUnsafeOptionalChaining": "off",
"useExhaustiveDependencies": "off",
Expand All @@ -15,7 +18,8 @@
"noUselessConstructor": "off",
"useOptionalChain": "warn",
"noStaticOnlyClass": "off",
"noForEach": "off"
"noForEach": "off",
"noUselessFragments": "off"
},
"style": {
"noNonNullAssertion": "off",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"gen:api:clean": "yarn gen:api && rm -rf src/openapi/apis && sed -i.bak '1q' src/openapi/index.ts && rm src/openapi/index.ts.bak"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@biomejs/biome": "1.9.4",
"@codemirror/lang-json": "6.0.1",
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const FeatureToggleListTable: VFC = () => {

const variant =
featureSearchFeedback !== false
? featureSearchFeedback?.name ?? ''
? (featureSearchFeedback?.name ?? '')
: '';

const { openFeedback } = useFeedback(
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/themes/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ html {

body {
min-height: 100%;
font-family: 'Sen', sans-serif;
font-family: "Sen", sans-serif;
font-size: 16px;
font-variant-ligatures: none;
padding: 0;
Expand All @@ -19,7 +19,7 @@ body {
}

button {
font-family: 'Sen', sans-serif;
font-family: "Sen", sans-serif;
font-variant-ligatures: none;
}

Expand All @@ -43,7 +43,7 @@ button {
}

.skeleton::before {
content: '';
content: "";
position: absolute;
top: 0px;
right: 0;
Expand All @@ -61,7 +61,7 @@ button {
left: 0;
transform: translateX(-100%);
animation: shimmer 3s infinite;
content: '';
content: "";
z-index: 5001;
}

Expand Down Expand Up @@ -104,8 +104,8 @@ button {
--dropdownMenuWidth: 200px;

/* BOX SHADOWS */
--chip-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
--chip-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px
rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);

/* BORDERS */
--default-border: 1px solid #f1f1f1;
Expand Down Expand Up @@ -152,10 +152,10 @@ a:hover {
}
}

input.hide-clear[type='search']::-webkit-search-decoration,
input.hide-clear[type='search']::-webkit-search-cancel-button,
input.hide-clear[type='search']::-webkit-search-results-button,
input.hide-clear[type='search']::-webkit-search-results-decoration {
input.hide-clear[type="search"]::-webkit-search-decoration,
input.hide-clear[type="search"]::-webkit-search-cancel-button,
input.hide-clear[type="search"]::-webkit-search-results-button,
input.hide-clear[type="search"]::-webkit-search-results-decoration {
display: none;
}

Expand Down
76 changes: 38 additions & 38 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,18 @@ __metadata:
languageName: node
linkType: hard

"@biomejs/biome@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/biome@npm:1.8.3"
dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.8.3"
"@biomejs/cli-darwin-x64": "npm:1.8.3"
"@biomejs/cli-linux-arm64": "npm:1.8.3"
"@biomejs/cli-linux-arm64-musl": "npm:1.8.3"
"@biomejs/cli-linux-x64": "npm:1.8.3"
"@biomejs/cli-linux-x64-musl": "npm:1.8.3"
"@biomejs/cli-win32-arm64": "npm:1.8.3"
"@biomejs/cli-win32-x64": "npm:1.8.3"
"@biomejs/biome@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/biome@npm:1.9.4"
dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.9.4"
"@biomejs/cli-darwin-x64": "npm:1.9.4"
"@biomejs/cli-linux-arm64": "npm:1.9.4"
"@biomejs/cli-linux-arm64-musl": "npm:1.9.4"
"@biomejs/cli-linux-x64": "npm:1.9.4"
"@biomejs/cli-linux-x64-musl": "npm:1.9.4"
"@biomejs/cli-win32-arm64": "npm:1.9.4"
"@biomejs/cli-win32-x64": "npm:1.9.4"
dependenciesMeta:
"@biomejs/cli-darwin-arm64":
optional: true
Expand All @@ -570,62 +570,62 @@ __metadata:
optional: true
bin:
biome: bin/biome
checksum: 10c0/95fe99ce82cd8242f1be51cbf3ac26043b253f5a369d3dc24df09bdb32ec04dba679b1d4fa8b9d602b1bf2c30ecd80af14aa8f5c92d6e0cd6214a99a1099a65b
checksum: 10c0/b5655c5aed9a6fffe24f7d04f15ba4444389d0e891c9ed9106fab7388ac9b4be63185852cc2a937b22940dac3e550b71032a4afd306925cfea436c33e5646b3e
languageName: node
linkType: hard

"@biomejs/cli-darwin-arm64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-darwin-arm64@npm:1.8.3"
"@biomejs/cli-darwin-arm64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-darwin-arm64@npm:1.9.4"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@biomejs/cli-darwin-x64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-darwin-x64@npm:1.8.3"
"@biomejs/cli-darwin-x64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-darwin-x64@npm:1.9.4"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@biomejs/cli-linux-arm64-musl@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.8.3"
"@biomejs/cli-linux-arm64-musl@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@biomejs/cli-linux-arm64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-linux-arm64@npm:1.8.3"
"@biomejs/cli-linux-arm64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-linux-arm64@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@biomejs/cli-linux-x64-musl@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-linux-x64-musl@npm:1.8.3"
"@biomejs/cli-linux-x64-musl@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@biomejs/cli-linux-x64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-linux-x64@npm:1.8.3"
"@biomejs/cli-linux-x64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-linux-x64@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@biomejs/cli-win32-arm64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-win32-arm64@npm:1.8.3"
"@biomejs/cli-win32-arm64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-win32-arm64@npm:1.9.4"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@biomejs/cli-win32-x64@npm:1.8.3":
version: 1.8.3
resolution: "@biomejs/cli-win32-x64@npm:1.8.3"
"@biomejs/cli-win32-x64@npm:1.9.4":
version: 1.9.4
resolution: "@biomejs/cli-win32-x64@npm:1.9.4"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
Expand Down Expand Up @@ -10073,7 +10073,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "unleash-frontend-local@workspace:."
dependencies:
"@biomejs/biome": "npm:1.8.3"
"@biomejs/biome": "npm:1.9.4"
"@codemirror/lang-json": "npm:6.0.1"
"@emotion/react": "npm:11.11.4"
"@emotion/styled": "npm:11.11.5"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"devDependencies": {
"@apidevtools/swagger-parser": "10.1.0",
"@babel/core": "7.25.9",
"@biomejs/biome": "^1.8.3",
"@biomejs/biome": "^1.9.4",
"@cyclonedx/yarn-plugin-cyclonedx": "^1.0.0-rc.7",
"@swc/core": "1.7.39",
"@swc/jest": "0.2.36",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/db/access-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ export class AccessStore implements IAccessStore {
}

async getUserAccessOverview(): Promise<IUserAccessOverview[]> {
const result = await this.db.raw(`SELECT u.id, u.created_at, u.name, u.email, u.seen_at, up.p_array as projects, gr.p_array as groups, gp.p_array as group_projects, r.name as root_role
const result =
await this.db.raw(`SELECT u.id, u.created_at, u.name, u.email, u.seen_at, up.p_array as projects, gr.p_array as groups, gp.p_array as group_projects, r.name as root_role
FROM users u, LATERAL (
SELECT ARRAY (
SELECT ru.project
Expand Down
3 changes: 2 additions & 1 deletion src/lib/features/instance-stats/getProductionChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export type GetProductionChanges = () => Promise<{
export const createGetProductionChanges =
(db: Db): GetProductionChanges =>
async () => {
const productionChanges = await db.raw(`SELECT SUM(CASE WHEN seu.day > NOW() - INTERVAL '30 days' THEN seu.updates END) AS last_month,
const productionChanges =
await db.raw(`SELECT SUM(CASE WHEN seu.day > NOW() - INTERVAL '30 days' THEN seu.updates END) AS last_month,
SUM(CASE WHEN seu.day > NOW() - INTERVAL '60 days' THEN seu.updates END) AS last_two_months,
SUM(CASE WHEN seu.day > NOW() - INTERVAL '90 days' THEN seu.updates END) AS last_quarter
FROM stat_environment_updates seu
Expand Down
18 changes: 13 additions & 5 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,22 @@ main img {
box-shadow: var(--ifm-global-shadow-lw);
}

main p>img:not([src^="https://img.shields.io/" i], [src*="badge.svg?branch=" i])
{
main
p
> img:not(
[src^="https://img.shields.io/" i],
[src*="badge.svg?branch=" i]
) {
/* give inline images a border */
border: var(--ifm-global-border-width) solid var(--unleash-color-gray);
}

main :is(p, figure)>img:not([src^="https://img.shields.io/" i], [src*="badge.svg?branch=" i])
{
main
:is(p, figure)
> img:not(
[src^="https://img.shields.io/" i],
[src*="badge.svg?branch=" i]
) {
/* round corners to match the rest of the page */
border-radius: var(--ifm-global-radius);

Expand Down Expand Up @@ -226,7 +234,7 @@ li.theme-doc-sidebar-item-category-level-1 > div::before {
}

.unleash-video-container iframe {
aspect-ratio: 16/9;
aspect-ratio: 16 / 9;
}

/* end video content container */
Expand Down
9 changes: 5 additions & 4 deletions website/src/theme/DocItem/Footer/contributors.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
display: block;
position: absolute;
z-index: 2;
content: '';
content: "";
top: -5px;
right: -5px;
width: 30px;
Expand All @@ -40,8 +40,9 @@
margin: 0;
padding: 0;
border: 2px solid var(--unleash-color-gray);
transition: border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default),
scale var(--ifm-transition-fast) var(--ifm-transition-timing-default);
transition: border-color var(--ifm-transition-fast)
var(--ifm-transition-timing-default), scale var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
}

.contributor img:hover {
Expand All @@ -53,4 +54,4 @@
.wrapper {
display: block;
}
}
}
Loading

0 comments on commit 8d4e3ef

Please sign in to comment.