chore: add more stylistic rules & run formatter

This commit is contained in:
ayo 2026-04-02 19:39:18 +02:00
parent bdec497bc1
commit 4520129f9f
4 changed files with 28 additions and 8 deletions

View file

@ -26,14 +26,28 @@ export default defineConfig([
},
{
files: ['**/*.{js,mjs,cjs}'],
plugins: { js, '@stylistic': stylistic},
plugins: {
js, '@stylistic': stylistic
},
extends: ['js/recommended'],
languageOptions: { globals: globals.browser },
languageOptions: {
globals: globals.browser
},
rules: {
'@stylistic/indent': ['error', 2],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': ['error', 'never'],
'@stylistic/comma-dangle': ['error', 'never']
'@stylistic/comma-dangle': ['error', 'never'] ,
'@stylistic/block-spacing': 'error',
'@stylistic/array-bracket-spacing': ['error', 'never'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/key-spacing': ['error', {
'beforeColon': false
}],
'@stylistic/array-bracket-newline': ['error', 'consistent'],
'@stylistic/object-curly-newline': ['error', {
'consistent': true
}]
}
},
globalIgnores(['dist'])

View file

@ -1,5 +1,5 @@
// forked from https://github.com/elk-zone/elk/blob/main/scripts/release.ts
import {simpleGit } from 'simple-git'
import { simpleGit } from 'simple-git'
const git = simpleGit()
const hash = await git.revparse(['main'])

View file

@ -175,7 +175,11 @@ export const Minesweeper = function(appId) {
const okButton = document.createElement('button')
okButton.innerText = 'Okay'
const setting = {rows: rowsInput.value, cols: colsInput.value, bombs: bombsInput.value}
const setting = {
rows: rowsInput.value,
cols: colsInput.value,
bombs: bombsInput.value
}
okButton.onmousedown = () => updateSetting('custom-action', setting)
inputElements.forEach(input => {

View file

@ -4,7 +4,9 @@ import { LoadingService } from '../loading/loading'
import { LoggerService } from '../logger/logger'
import { initializeApp } from 'firebase/app'
import { getFirestore, doc, getDocs, getDoc, setDoc, collection, query, orderBy, limit } from 'firebase/firestore/lite'
import {
getFirestore, doc, getDocs, getDoc, setDoc, collection, query, orderBy, limit
} from 'firebase/firestore/lite'
export class LeaderBoardService {
@ -136,11 +138,11 @@ export class LeaderBoardService {
async send(game, key) {
const sessionId = new Date().toDateString().replace(/\s/g, '_')
const gameId = new Date().toTimeString().replace(/\s/g, '_')
const data = {}
const data = { }
data[gameId] = game
const sessionRef = doc(this.store, 'mw-all', this.user.browserId, 'games', sessionId)
await setDoc(sessionRef, data, {merge: true})
await setDoc(sessionRef, data, { merge: true })
if (this.configuration && game.status === this.configuration.passingStatus && game[key] < this.lastPlace) {
let name = window.prompt(this.configuration.message)