Skip to content

Commit

Permalink
Use biome instead of prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tyilo committed Jul 6, 2024
1 parent 344ed97 commit ad06b81
Show file tree
Hide file tree
Showing 20 changed files with 440 additions and 449 deletions.
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ repos:
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
- repo: https://github.com/biomejs/pre-commit
rev: v0.4.0
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- [email protected]
- [email protected]
- id: biome-check
additional_dependencies: ["@biomejs/[email protected]"]

- repo: https://github.com/Tyilo/pre-commit-django-migrations
rev: d3a23e91aeb76b3c6b0f934d734c0dca237840ae
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

28 changes: 14 additions & 14 deletions svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "*",
"svelte": "*",
"svelte-preprocess": "*",
"typescript": "*",
"vite": "*"
}
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "*",
"svelte": "*",
"svelte-preprocess": "*",
"typescript": "*",
"vite": "*"
}
}
2 changes: 1 addition & 1 deletion svelte/src/CardCell.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<svelte:options immutable />

<script context="module" lang="ts">
import { card_constants } from "./globals";
import { card_constants } from "./globals";
</script>

<script lang="ts">
Expand Down
4 changes: 2 additions & 2 deletions svelte/src/Chug.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script context="module" lang="ts">
import type { ChugData } from "./types";
import { formatDuration } from "./globals";
import { formatDuration } from "./globals";
import type { ChugData } from "./types";
</script>

<script lang="ts">
Expand Down
4 changes: 2 additions & 2 deletions svelte/src/ColoredSuit.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<svelte:options immutable />

<script context="module" lang="ts">
import { card_constants } from "./globals";
import type { CardData } from "./types";
import { card_constants } from "./globals";
import type { CardData } from "./types";
</script>

<script lang="ts">
Expand Down
16 changes: 8 additions & 8 deletions svelte/src/GameDetail.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script context="module" lang="ts">
import {
is_authenticated,
is_staff,
formatDate,
formatDuration,
moment,
} from "./globals";
import type { GameData, GamePlayerData, ChugData } from "./types";
import {
formatDate,
formatDuration,
is_authenticated,
is_staff,
moment,
} from "./globals";
import type { ChugData, GameData, GamePlayerData } from "./types";
</script>

<script lang="ts">
Expand Down
4 changes: 3 additions & 1 deletion svelte/src/GameDetail_init.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import GameDetail from "./GameDetail.svelte";

const target = document.querySelector("#svelte-game_detail");

export default new GameDetail({
target: document.querySelector("#svelte-game_detail")!,
target,
});
2 changes: 1 addition & 1 deletion svelte/src/Image.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
export let url;
export let url;
</script>

<div class="center">
Expand Down
47 changes: 22 additions & 25 deletions svelte/src/Map.svelte
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
<script lang="ts">
import type { Location } from "./types";
import type { Location } from "./types";
export let location: Location;
export let location: Location;
import { onMount } from "svelte";
const L = window.L;
import { onMount } from "svelte";
const L = window.L;
let mapEl;
onMount(() => {
const map = L.map(mapEl).setView(
[location.latitude, location.longitude],
13
);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
L.marker([location.latitude, location.longitude])
.addTo(map)
.bindPopup(location.latitude + ", " + location.longitude);
const circle = L.circle([location.latitude, location.longitude], {
color: "red",
fillColor: "#f03",
fillOpacity: 0.5,
radius: location.accuracy,
}).addTo(map);
map.fitBounds(map.getBounds().extend(circle.getBounds()));
});
let mapEl: HTMLElement;
onMount(() => {
const map = L.map(mapEl).setView([location.latitude, location.longitude], 13);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
L.marker([location.latitude, location.longitude])
.addTo(map)
.bindPopup(`${location.latitude}, ${location.longitude}`);
const circle = L.circle([location.latitude, location.longitude], {
color: "red",
fillColor: "#f03",
fillOpacity: 0.5,
radius: location.accuracy,
}).addTo(map);
map.fitBounds(map.getBounds().extend(circle.getBounds()));
});
</script>

<div class="map" bind:this={mapEl} />
Expand Down
22 changes: 11 additions & 11 deletions svelte/src/PlayerStats.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<script lang="ts">
import type { PlayerStatsData } from "./types";
import type { PlayerStatsData } from "./types";
export let player_stats: PlayerStatsData;
export let sips_per_beer: number;
export let player_stats: PlayerStatsData;
export let sips_per_beer: number;
import { formatDuration } from "./globals";
import { formatDuration } from "./globals";
let ps: PlayerStatsData;
$: ps = player_stats;
let ps: PlayerStatsData;
$: ps = player_stats;
function format(s: number, f?: (s: number) => string) {
if (s === null) return "?";
if (!f) return s;
return f(s);
}
function format(s: number, f?: (s: number) => string) {
if (s === null) return "?";
if (!f) return s;
return f(s);
}
</script>

<div style="margin: 6px 0px; border-bottom: 1px solid #eee; display: flex;">
Expand Down
8 changes: 4 additions & 4 deletions svelte/src/Players.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import type { GameData, GamePlayerData } from "./types";
import PlayerStats from "./PlayerStats.svelte";
import PlayerStats from "./PlayerStats.svelte";
import type { GameData, GamePlayerData } from "./types";
export let game_data: GameData;
export let ordered_gameplayers: GamePlayerData[];
export let game_data: GameData;
export let ordered_gameplayers: GamePlayerData[];
</script>

{#each ordered_gameplayers as gp, i}
Expand Down
Loading

0 comments on commit ad06b81

Please sign in to comment.