fix: fix lint by using polyfill
This commit is contained in:
13
frontend/eslint-polyfill.mjs
Normal file
13
frontend/eslint-polyfill.mjs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// Polyfill for Object.groupBy (requires Node.js 21+, we're on 20)
|
||||||
|
// This must be imported before any code that uses Object.groupBy
|
||||||
|
if (typeof Object.groupBy === 'undefined') {
|
||||||
|
Object.groupBy = (items, keyFn) => {
|
||||||
|
const result = {}
|
||||||
|
let index = 0
|
||||||
|
for (const item of items) {
|
||||||
|
const key = keyFn(item, index++)
|
||||||
|
;(result[key] ??= []).push(item)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
import './eslint-polyfill.mjs'
|
||||||
import withNuxt from './.nuxt/eslint.config.mjs'
|
import withNuxt from './.nuxt/eslint.config.mjs'
|
||||||
|
|
||||||
import js from '@eslint/js'
|
import js from '@eslint/js'
|
||||||
|
|||||||
Reference in New Issue
Block a user