Skip to content

Commit

Permalink
refactor: upgrade to biome 1.9 and fix new errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flexagoon committed Sep 14, 2024
1 parent 0ace2ff commit f3b78cb
Show file tree
Hide file tree
Showing 7 changed files with 620 additions and 575 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"noDelete": "off"
},
"suspicious": {
"noConsole": "off",
"noConsoleLog": "off"
}
}
Expand Down
1,142 changes: 586 additions & 556 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions resources/stylesheet-prefs.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
.page { padding: 10px 30px; }
.code { padding: 10px 16px;}
.edit-win { background: #eeeeee; color: black; padding: 20px 80px; }
.flat { background: none; border: none;}
.page {
padding: 10px 30px;
}
.code {
padding: 10px 16px;
}
.edit-win {
background: #eeeeee;
color: black;
padding: 20px 80px;
}
.flat {
background: none;
border: none;
}

.expander_img {
transition: all 100ms;
Expand All @@ -21,4 +32,4 @@

.dialog-vbox checkbutton {
padding-right: 12px;
}
}
8 changes: 4 additions & 4 deletions resources/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.shadow {
box-shadow: 0px 0px 0px 0px rgba(83, 83, 83, 0.0);
transition-duration: 300ms;
transition-property: box-shadow;
transition-timing-function: linear;
box-shadow: 0px 0px 0px 0px rgba(83, 83, 83, 0.0);
transition-duration: 300ms;
transition-property: box-shadow;
transition-timing-function: linear;
}
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ export default class RoundedWindowCornersReborn extends Extension {
// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js
// /ui/windowPreview.js#L42

const stack = Error().stack?.trim();
// Create a new error object and use it to get the call stack of
// the function.
//
// Since the error is not actually being raised, it doesn't need
// an error message.
// biome-ignore lint/suspicious/useErrorMessage:
const stack = new Error().stack?.trim();
if (
stack === undefined ||
stack.indexOf('_updateAttachedDialogs') !== -1 ||
Expand Down
12 changes: 3 additions & 9 deletions src/preferences/widgets/edit_shadow_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,12 @@ export const EditShadowPage = GObject.registerClass(
}

private update_background(manager: Adw.StyleManager) {
let path = '';
const backgrounds = Gio.Settings.new(
'org.gnome.desktop.background',
);
switch (manager.get_dark()) {
case true:
path = backgrounds.get_string('picture-uri-dark');
break;
case false:
path = backgrounds.get_string('picture-uri');
break;
}
const path = manager.get_dark()
? backgrounds.get_string('picture-uri-dark')
: backgrounds.get_string('picture-uri');
this.backgroud_provider.load_from_string(`.desktop-background {
background: url("${path}");
background-size: cover;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export function readRelativeFile(module: string, path: string) {
*/
export function readShader(module: string, path: string) {
const shader = readRelativeFile(module, path);
// This function isn't called very often, so creating the regex at the top
// level doesn't really make sense.
// biome-ignore lint/performance/useTopLevelRegex:
let [declarations, code] = shader.split(/^.*?main\(\s?\)\s?/m);
declarations = declarations.trim();
code = code.trim().replace(/^[{}]/gm, '').trim();
Expand Down

0 comments on commit f3b78cb

Please sign in to comment.