Skip to content

Commit 713b51a

Browse files
authored
Remove archived prettier repo from pre-commit (#374)
* Remove archived prettier repo from pre-commit * Run biome * Clean up biome.json
1 parent 5cddac8 commit 713b51a

5 files changed

Lines changed: 27 additions & 42 deletions

File tree

.eleventy.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const yaml = require("js-yaml");
22

3-
module.exports = function (eleventyConfig) {
4-
eleventyConfig.addShortcode("currentYear", function () {
5-
return new Date().getFullYear();
6-
});
3+
module.exports = (eleventyConfig) => {
4+
eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear());
75
// Add this line to copy your external assets
86
eleventyConfig.addPassthroughCopy("src/assets");
97
// 1. Recognize YAML as a template format
@@ -27,12 +25,12 @@ module.exports = function (eleventyConfig) {
2725
});
2826

2927
// 2. The Randomized Collection
30-
eleventyConfig.addCollection("randomPeople", function (collectionApi) {
28+
eleventyConfig.addCollection("randomPeople", (collectionApi) => {
3129
// Grab all yaml files from the users folder
3230
const people = collectionApi.getFilteredByGlob("src/users/*.yaml");
3331

3432
// Create a copy of the array to avoid mutating the original global collection
35-
let shuffled = [...people];
33+
const shuffled = [...people];
3634

3735
// Fisher-Yates Shuffle
3836
for (let i = shuffled.length - 1; i > 0; i--) {

.pre-commit-config.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,6 @@ repos:
121121
description: Run Biome linter and formatter for JSON files
122122
additional_dependencies: ["@biomejs/biome"]
123123

124-
- repo: https://github.com/pre-commit/mirrors-prettier
125-
rev: v4.0.0-alpha.8
126-
hooks:
127-
- id: prettier
128-
name: run prettier
129-
types_or: [css, html, javascript, json, markdown, yaml]
130-
additional_dependencies: ["prettier@3.8.1"]
131-
132124
- repo: https://github.com/igorshubovych/markdownlint-cli
133125
rev: v0.48.0
134126
hooks:

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
33
"files": {
4-
"includes": ["**/*.json"]
4+
"includes": ["**/*.json", "**/*.njk"]
55
},
66
"linter": {
77
"enabled": true,

src/assets/js/eggs.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,40 +187,35 @@ function spawnExplosion(scene) {
187187
}
188188

189189
function setupSpaceInvaders() {
190-
const scene = this;
191-
192190
// Player Rocket
193-
player = scene.add.text(
194-
window.innerWidth / 2,
195-
window.innerHeight - 80,
196-
"🚀",
197-
{ fontSize: "50px" },
198-
);
199-
scene.physics.add.existing(player);
191+
player = this.add.text(window.innerWidth / 2, window.innerHeight - 80, "🚀", {
192+
fontSize: "50px",
193+
});
194+
this.physics.add.existing(player);
200195
player.body.setCollideWorldBounds(true);
201196

202197
// Bullets
203-
bullets = scene.physics.add.group();
198+
bullets = this.physics.add.group();
204199

205200
// Aliens Grid - Adjusted for smaller size
206-
aliens = scene.physics.add.group();
201+
aliens = this.physics.add.group();
207202
const rows = 5;
208203
const cols = 10;
209204
const spacingX = 50; // Tighter horizontal spacing
210205
const spacingY = 45; // Tighter vertical spacing
211206

212207
for (let y = 0; y < rows; y++) {
213208
for (let x = 0; x < cols; x++) {
214-
let alienEmoji = ["👾", "👽", "🛸", "🐙", "👾"][y];
209+
const alienEmoji = ["👾", "👽", "🛸", "🐙", "👾"][y];
215210
// Shrink from 35px to 24px
216-
let alien = scene.add.text(
211+
const alien = this.add.text(
217212
x * spacingX + 80,
218213
y * spacingY + 80,
219214
alienEmoji,
220215
{ fontSize: "24px" },
221216
);
222217

223-
scene.physics.add.existing(alien);
218+
this.physics.add.existing(alien);
224219
alien.body.setAllowGravity(false);
225220
// Shrink the collision box to match the smaller emoji
226221
alien.body.setSize(24, 24);
@@ -230,16 +225,16 @@ function setupSpaceInvaders() {
230225
}
231226

232227
// Alien Movement Timer
233-
scene.alienDirection = 1;
234-
scene.time.addEvent({
228+
this.alienDirection = 1;
229+
this.time.addEvent({
235230
delay: 800,
236231
callback: moveAliens,
237-
callbackScope: scene,
232+
callbackScope: this,
238233
loop: true,
239234
});
240235

241236
// Collisions
242-
scene.physics.add.overlap(bullets, aliens, (bullet, alien) => {
237+
this.physics.add.overlap(bullets, aliens, (bullet, alien) => {
243238
bullet.destroy();
244239
alien.destroy();
245240
if (aliens.countActive() === 0) {
@@ -248,7 +243,7 @@ function setupSpaceInvaders() {
248243
}
249244
});
250245

251-
cursors = scene.input.keyboard.createCursorKeys();
246+
cursors = this.input.keyboard.createCursorKeys();
252247
}
253248

254249
function moveAliens() {

src/assets/js/script.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let isSurging = false;
1717

1818
let audioCtx;
1919

20-
let unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs")) || [];
20+
const unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs")) || [];
2121
let surpriseClickCount = 0;
2222
let matrixActive = false;
2323
let destructInterval;
@@ -312,7 +312,7 @@ function reopenConsole() {
312312
let isProcessingXP = false;
313313

314314
// Ensure this is in the GLOBAL scope (not hidden inside another function)
315-
window.createFloatingXP = function (e) {
315+
window.createFloatingXP = (e) => {
316316
// Prevent "spam" firing from high-speed mouse movement
317317
if (isProcessingXP) return;
318318
isProcessingXP = true;
@@ -837,7 +837,7 @@ document
837837
/**
838838
* 7. SELF DESTRUCT ENGINE
839839
*/
840-
window.startSelfDestruct = function () {
840+
window.startSelfDestruct = () => {
841841
const btn = document.getElementById("self-destruct-btn");
842842
const devPanel = document.getElementById("dev-tools");
843843

@@ -965,7 +965,7 @@ function scrollToRandomUser() {
965965
/**
966966
* UTILITY: SCREENSHOT MODE
967967
*/
968-
window.toggleScreenshotMode = function () {
968+
window.toggleScreenshotMode = () => {
969969
const devPanel = document.getElementById("dev-tools");
970970
const header = document.querySelector("header");
971971
const footer = document.querySelector("footer");
@@ -1081,7 +1081,7 @@ document.addEventListener("keydown", (e) => {
10811081

10821082
async function addExperience(amount) {
10831083
// 1. Force strict numeric types to prevent "1" + "1" = "11"
1084-
let xpToAdd = Number(amount) || 0;
1084+
const xpToAdd = Number(amount) || 0;
10851085
currentXP = Number(currentXP) || 0;
10861086
currentLevel = Number(currentLevel) || 0;
10871087
const XP_THRESHOLD = 45;
@@ -1143,7 +1143,7 @@ function updateInventoryCounts(lvl) {
11431143
const levelEntry = LEVELS[i];
11441144
if (levelEntry?.rarity) {
11451145
const r = levelEntry.rarity.toLowerCase();
1146-
if (counts.hasOwnProperty(r)) {
1146+
if (Object.hasOwn(counts, r)) {
11471147
counts[r]++;
11481148
}
11491149
}
@@ -1278,7 +1278,7 @@ function initProfileTracker() {
12781278

12791279
// Only increment if the link text contains "Profile"
12801280
if (targetLink?.textContent?.includes("Profile")) {
1281-
let currentCount = parseInt(
1281+
const currentCount = parseInt(
12821282
localStorage.getItem("profile_view_count") || 0,
12831283
);
12841284
localStorage.setItem("profile_view_count", currentCount + 1);

0 commit comments

Comments
 (0)