diff --git a/frontend/eslint-polyfill.mjs b/frontend/eslint-polyfill.mjs new file mode 100644 index 0000000..fc8e3fe --- /dev/null +++ b/frontend/eslint-polyfill.mjs @@ -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 + } +} diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index c113c5a..8d07441 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -1,4 +1,5 @@ // @ts-check +import './eslint-polyfill.mjs' import withNuxt from './.nuxt/eslint.config.mjs' import js from '@eslint/js'