1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-04 11:17:02 +02:00

chore: upgrade to biome 1.9.4 (#8616)

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.
This commit is contained in:
Christopher Kolstad 2024-10-31 15:24:22 +01:00 committed by GitHub
parent 7f5d27302e
commit 8d4e3efbc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 115 additions and 100 deletions

View File

@ -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": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true, "recommended": true,
"a11y": {
"useSemanticElements": "off"
},
"correctness": { "correctness": {
"noUnsafeOptionalChaining": "off", "noUnsafeOptionalChaining": "off",
"useExhaustiveDependencies": "off", "useExhaustiveDependencies": "off",
@ -15,7 +18,8 @@
"noUselessConstructor": "off", "noUselessConstructor": "off",
"useOptionalChain": "warn", "useOptionalChain": "warn",
"noStaticOnlyClass": "off", "noStaticOnlyClass": "off",
"noForEach": "off" "noForEach": "off",
"noUselessFragments": "off"
}, },
"style": { "style": {
"noNonNullAssertion": "off", "noNonNullAssertion": "off",

View File

@ -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" "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": { "devDependencies": {
"@biomejs/biome": "1.8.3", "@biomejs/biome": "1.9.4",
"@codemirror/lang-json": "6.0.1", "@codemirror/lang-json": "6.0.1",
"@emotion/react": "11.11.4", "@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5", "@emotion/styled": "11.11.5",

View File

@ -70,7 +70,7 @@ export const FeatureToggleListTable: VFC = () => {
const variant = const variant =
featureSearchFeedback !== false featureSearchFeedback !== false
? featureSearchFeedback?.name ?? '' ? (featureSearchFeedback?.name ?? '')
: ''; : '';
const { openFeedback } = useFeedback( const { openFeedback } = useFeedback(

View File

@ -10,7 +10,7 @@ html {
body { body {
min-height: 100%; min-height: 100%;
font-family: 'Sen', sans-serif; font-family: "Sen", sans-serif;
font-size: 16px; font-size: 16px;
font-variant-ligatures: none; font-variant-ligatures: none;
padding: 0; padding: 0;
@ -19,7 +19,7 @@ body {
} }
button { button {
font-family: 'Sen', sans-serif; font-family: "Sen", sans-serif;
font-variant-ligatures: none; font-variant-ligatures: none;
} }
@ -43,7 +43,7 @@ button {
} }
.skeleton::before { .skeleton::before {
content: ''; content: "";
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0; right: 0;
@ -61,7 +61,7 @@ button {
left: 0; left: 0;
transform: translateX(-100%); transform: translateX(-100%);
animation: shimmer 3s infinite; animation: shimmer 3s infinite;
content: ''; content: "";
z-index: 5001; z-index: 5001;
} }
@ -104,8 +104,8 @@ button {
--dropdownMenuWidth: 200px; --dropdownMenuWidth: 200px;
/* BOX SHADOWS */ /* BOX SHADOWS */
--chip-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), --chip-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px
0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
/* BORDERS */ /* BORDERS */
--default-border: 1px solid #f1f1f1; --default-border: 1px solid #f1f1f1;
@ -152,10 +152,10 @@ a:hover {
} }
} }
input.hide-clear[type='search']::-webkit-search-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-cancel-button,
input.hide-clear[type='search']::-webkit-search-results-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-results-decoration {
display: none; display: none;
} }

View File

@ -539,18 +539,18 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/biome@npm:1.8.3": "@biomejs/biome@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/biome@npm:1.8.3" resolution: "@biomejs/biome@npm:1.9.4"
dependencies: dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.8.3" "@biomejs/cli-darwin-arm64": "npm:1.9.4"
"@biomejs/cli-darwin-x64": "npm:1.8.3" "@biomejs/cli-darwin-x64": "npm:1.9.4"
"@biomejs/cli-linux-arm64": "npm:1.8.3" "@biomejs/cli-linux-arm64": "npm:1.9.4"
"@biomejs/cli-linux-arm64-musl": "npm:1.8.3" "@biomejs/cli-linux-arm64-musl": "npm:1.9.4"
"@biomejs/cli-linux-x64": "npm:1.8.3" "@biomejs/cli-linux-x64": "npm:1.9.4"
"@biomejs/cli-linux-x64-musl": "npm:1.8.3" "@biomejs/cli-linux-x64-musl": "npm:1.9.4"
"@biomejs/cli-win32-arm64": "npm:1.8.3" "@biomejs/cli-win32-arm64": "npm:1.9.4"
"@biomejs/cli-win32-x64": "npm:1.8.3" "@biomejs/cli-win32-x64": "npm:1.9.4"
dependenciesMeta: dependenciesMeta:
"@biomejs/cli-darwin-arm64": "@biomejs/cli-darwin-arm64":
optional: true optional: true
@ -570,62 +570,62 @@ __metadata:
optional: true optional: true
bin: bin:
biome: bin/biome biome: bin/biome
checksum: 10c0/95fe99ce82cd8242f1be51cbf3ac26043b253f5a369d3dc24df09bdb32ec04dba679b1d4fa8b9d602b1bf2c30ecd80af14aa8f5c92d6e0cd6214a99a1099a65b checksum: 10c0/b5655c5aed9a6fffe24f7d04f15ba4444389d0e891c9ed9106fab7388ac9b4be63185852cc2a937b22940dac3e550b71032a4afd306925cfea436c33e5646b3e
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-darwin-arm64@npm:1.8.3": "@biomejs/cli-darwin-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-darwin-arm64@npm:1.8.3" resolution: "@biomejs/cli-darwin-arm64@npm:1.9.4"
conditions: os=darwin & cpu=arm64 conditions: os=darwin & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-darwin-x64@npm:1.8.3": "@biomejs/cli-darwin-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-darwin-x64@npm:1.8.3" resolution: "@biomejs/cli-darwin-x64@npm:1.9.4"
conditions: os=darwin & cpu=x64 conditions: os=darwin & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-arm64-musl@npm:1.8.3": "@biomejs/cli-linux-arm64-musl@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.8.3" resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=musl conditions: os=linux & cpu=arm64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-arm64@npm:1.8.3": "@biomejs/cli-linux-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-arm64@npm:1.8.3" resolution: "@biomejs/cli-linux-arm64@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=glibc conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-x64-musl@npm:1.8.3": "@biomejs/cli-linux-x64-musl@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-x64-musl@npm:1.8.3" resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=musl conditions: os=linux & cpu=x64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-x64@npm:1.8.3": "@biomejs/cli-linux-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-x64@npm:1.8.3" resolution: "@biomejs/cli-linux-x64@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=glibc conditions: os=linux & cpu=x64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-win32-arm64@npm:1.8.3": "@biomejs/cli-win32-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-win32-arm64@npm:1.8.3" resolution: "@biomejs/cli-win32-arm64@npm:1.9.4"
conditions: os=win32 & cpu=arm64 conditions: os=win32 & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-win32-x64@npm:1.8.3": "@biomejs/cli-win32-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-win32-x64@npm:1.8.3" resolution: "@biomejs/cli-win32-x64@npm:1.9.4"
conditions: os=win32 & cpu=x64 conditions: os=win32 & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
@ -10073,7 +10073,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "unleash-frontend-local@workspace:." resolution: "unleash-frontend-local@workspace:."
dependencies: dependencies:
"@biomejs/biome": "npm:1.8.3" "@biomejs/biome": "npm:1.9.4"
"@codemirror/lang-json": "npm:6.0.1" "@codemirror/lang-json": "npm:6.0.1"
"@emotion/react": "npm:11.11.4" "@emotion/react": "npm:11.11.4"
"@emotion/styled": "npm:11.11.5" "@emotion/styled": "npm:11.11.5"

View File

@ -174,7 +174,7 @@
"devDependencies": { "devDependencies": {
"@apidevtools/swagger-parser": "10.1.0", "@apidevtools/swagger-parser": "10.1.0",
"@babel/core": "7.25.9", "@babel/core": "7.25.9",
"@biomejs/biome": "^1.8.3", "@biomejs/biome": "^1.9.4",
"@cyclonedx/yarn-plugin-cyclonedx": "^1.0.0-rc.7", "@cyclonedx/yarn-plugin-cyclonedx": "^1.0.0-rc.7",
"@swc/core": "1.7.39", "@swc/core": "1.7.39",
"@swc/jest": "0.2.36", "@swc/jest": "0.2.36",

View File

@ -943,7 +943,8 @@ export class AccessStore implements IAccessStore {
} }
async getUserAccessOverview(): Promise<IUserAccessOverview[]> { 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 ( FROM users u, LATERAL (
SELECT ARRAY ( SELECT ARRAY (
SELECT ru.project SELECT ru.project

View File

@ -9,7 +9,8 @@ export type GetProductionChanges = () => Promise<{
export const createGetProductionChanges = export const createGetProductionChanges =
(db: Db): GetProductionChanges => (db: Db): GetProductionChanges =>
async () => { 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 '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 SUM(CASE WHEN seu.day > NOW() - INTERVAL '90 days' THEN seu.updates END) AS last_quarter
FROM stat_environment_updates seu FROM stat_environment_updates seu

View File

@ -147,14 +147,22 @@ main img {
box-shadow: var(--ifm-global-shadow-lw); 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 */ /* give inline images a border */
border: var(--ifm-global-border-width) solid var(--unleash-color-gray); 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 */ /* round corners to match the rest of the page */
border-radius: var(--ifm-global-radius); border-radius: var(--ifm-global-radius);
@ -226,7 +234,7 @@ li.theme-doc-sidebar-item-category-level-1 > div::before {
} }
.unleash-video-container iframe { .unleash-video-container iframe {
aspect-ratio: 16/9; aspect-ratio: 16 / 9;
} }
/* end video content container */ /* end video content container */

View File

@ -23,7 +23,7 @@
display: block; display: block;
position: absolute; position: absolute;
z-index: 2; z-index: 2;
content: ''; content: "";
top: -5px; top: -5px;
right: -5px; right: -5px;
width: 30px; width: 30px;
@ -40,8 +40,9 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 2px solid var(--unleash-color-gray); border: 2px solid var(--unleash-color-gray);
transition: border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default), transition: border-color var(--ifm-transition-fast)
scale var(--ifm-transition-fast) var(--ifm-transition-timing-default); var(--ifm-transition-timing-default), scale var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
} }
.contributor img:hover { .contributor img:hover {

View File

@ -829,18 +829,18 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/biome@npm:^1.8.3": "@biomejs/biome@npm:^1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/biome@npm:1.8.3" resolution: "@biomejs/biome@npm:1.9.4"
dependencies: dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.8.3" "@biomejs/cli-darwin-arm64": "npm:1.9.4"
"@biomejs/cli-darwin-x64": "npm:1.8.3" "@biomejs/cli-darwin-x64": "npm:1.9.4"
"@biomejs/cli-linux-arm64": "npm:1.8.3" "@biomejs/cli-linux-arm64": "npm:1.9.4"
"@biomejs/cli-linux-arm64-musl": "npm:1.8.3" "@biomejs/cli-linux-arm64-musl": "npm:1.9.4"
"@biomejs/cli-linux-x64": "npm:1.8.3" "@biomejs/cli-linux-x64": "npm:1.9.4"
"@biomejs/cli-linux-x64-musl": "npm:1.8.3" "@biomejs/cli-linux-x64-musl": "npm:1.9.4"
"@biomejs/cli-win32-arm64": "npm:1.8.3" "@biomejs/cli-win32-arm64": "npm:1.9.4"
"@biomejs/cli-win32-x64": "npm:1.8.3" "@biomejs/cli-win32-x64": "npm:1.9.4"
dependenciesMeta: dependenciesMeta:
"@biomejs/cli-darwin-arm64": "@biomejs/cli-darwin-arm64":
optional: true optional: true
@ -860,62 +860,62 @@ __metadata:
optional: true optional: true
bin: bin:
biome: bin/biome biome: bin/biome
checksum: 10c0/95fe99ce82cd8242f1be51cbf3ac26043b253f5a369d3dc24df09bdb32ec04dba679b1d4fa8b9d602b1bf2c30ecd80af14aa8f5c92d6e0cd6214a99a1099a65b checksum: 10c0/b5655c5aed9a6fffe24f7d04f15ba4444389d0e891c9ed9106fab7388ac9b4be63185852cc2a937b22940dac3e550b71032a4afd306925cfea436c33e5646b3e
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-darwin-arm64@npm:1.8.3": "@biomejs/cli-darwin-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-darwin-arm64@npm:1.8.3" resolution: "@biomejs/cli-darwin-arm64@npm:1.9.4"
conditions: os=darwin & cpu=arm64 conditions: os=darwin & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-darwin-x64@npm:1.8.3": "@biomejs/cli-darwin-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-darwin-x64@npm:1.8.3" resolution: "@biomejs/cli-darwin-x64@npm:1.9.4"
conditions: os=darwin & cpu=x64 conditions: os=darwin & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-arm64-musl@npm:1.8.3": "@biomejs/cli-linux-arm64-musl@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.8.3" resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=musl conditions: os=linux & cpu=arm64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-arm64@npm:1.8.3": "@biomejs/cli-linux-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-arm64@npm:1.8.3" resolution: "@biomejs/cli-linux-arm64@npm:1.9.4"
conditions: os=linux & cpu=arm64 & libc=glibc conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-x64-musl@npm:1.8.3": "@biomejs/cli-linux-x64-musl@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-x64-musl@npm:1.8.3" resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=musl conditions: os=linux & cpu=x64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-linux-x64@npm:1.8.3": "@biomejs/cli-linux-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-linux-x64@npm:1.8.3" resolution: "@biomejs/cli-linux-x64@npm:1.9.4"
conditions: os=linux & cpu=x64 & libc=glibc conditions: os=linux & cpu=x64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-win32-arm64@npm:1.8.3": "@biomejs/cli-win32-arm64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-win32-arm64@npm:1.8.3" resolution: "@biomejs/cli-win32-arm64@npm:1.9.4"
conditions: os=win32 & cpu=arm64 conditions: os=win32 & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@biomejs/cli-win32-x64@npm:1.8.3": "@biomejs/cli-win32-x64@npm:1.9.4":
version: 1.8.3 version: 1.9.4
resolution: "@biomejs/cli-win32-x64@npm:1.8.3" resolution: "@biomejs/cli-win32-x64@npm:1.9.4"
conditions: os=win32 & cpu=x64 conditions: os=win32 & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
@ -9272,7 +9272,7 @@ __metadata:
dependencies: dependencies:
"@apidevtools/swagger-parser": "npm:10.1.0" "@apidevtools/swagger-parser": "npm:10.1.0"
"@babel/core": "npm:7.25.9" "@babel/core": "npm:7.25.9"
"@biomejs/biome": "npm:^1.8.3" "@biomejs/biome": "npm:^1.9.4"
"@cyclonedx/yarn-plugin-cyclonedx": "npm:^1.0.0-rc.7" "@cyclonedx/yarn-plugin-cyclonedx": "npm:^1.0.0-rc.7"
"@slack/web-api": "npm:^7.3.4" "@slack/web-api": "npm:^7.3.4"
"@swc/core": "npm:1.7.39" "@swc/core": "npm:1.7.39"