Skip to content

Commit

Permalink
fix new user signup issue, update lint
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Jul 2, 2024
1 parent ccd0f25 commit 35d6b0f
Show file tree
Hide file tree
Showing 11 changed files with 3,478 additions and 2,455 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

29 changes: 29 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import love from 'eslint-config-love'

export default [
{
ignores: [
'node_modules/',
'dist/',
'.vscode/',
'src/generated/'
]
},
{
...love,
files: ["**/*.js", "**/*.ts", "**/*.mjs"]
},
{
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off'
}
}
]
10 changes: 5 additions & 5 deletions migrations/202309031700-update-competition-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ async function run () {
// get all categories
const categories = await firestore.collection('categories').get()
for (const category of categories.docs) {
const rulesId = category.get('rulesId')
const rulesId = category.get('rulesId') as string

const entryLimit = pLimit(100)
const entries = await firestore.collection('entries').where('categoryId', '==', category.id).get()
await Promise.all(entries.docs.map(async dSnap => entryLimit(async () => {
const oldId = dSnap.get('competitionEventId')
const oldId = dSnap.get('competitionEventId') as string
if (typeof oldId === 'string' && oldId.includes('@')) return
return firestore.collection('entries').doc(dSnap.id).update({
competitionEventId: getNewCEvt(rulesId, oldId)
Expand All @@ -58,7 +58,7 @@ async function run () {
const scshLimit = pLimit(100)
const scoresheets = await getScoresheetsByEntryIds(entries.docs.map(dSnap => dSnap.id))
await Promise.all(scoresheets.map(async dSnap => scshLimit(async () => {
const oldId = dSnap.get('competitionEventId')
const oldId = dSnap.get('competitionEventId') as string
if (typeof oldId === 'string' && oldId.includes('@')) return
return firestore.collection('scoresheets').doc(dSnap.id).update({
competitionEventId: getNewCEvt(rulesId, oldId)
Expand All @@ -68,7 +68,7 @@ async function run () {
const jALimit = pLimit(100)
const judgeAssignments = await firestore.collection('judge-assignments').where('categoryId', '==', category.id).get()
await Promise.all(judgeAssignments.docs.map(async dSnap => jALimit(async () => {
const oldId = dSnap.get('competitionEventId')
const oldId = dSnap.get('competitionEventId') as string
if (typeof oldId === 'string' && oldId.includes('@')) return
return firestore.collection('judge-assignments').doc(dSnap.id).update({
competitionEventId: getNewCEvt(rulesId, oldId)
Expand All @@ -80,7 +80,7 @@ async function run () {
competitionEventIds: (category.get('competitionEventIds') as string[]).map(cEvt => getNewCEvt(rulesId, cEvt)),
...(category.get('pagePrintConfig') != null
? {
pagePrintConfig: Object.fromEntries(Object.entries(category.get('pagePrintConfig')).map(([cEvt, v]) => [getNewCEvt(rulesId, cEvt), v]))
pagePrintConfig: Object.fromEntries(Object.entries(category.get('pagePrintConfig') as Record<string, unknown>).map(([cEvt, v]) => [getNewCEvt(rulesId, cEvt), v]))
}
: {})
})
Expand Down
Loading

0 comments on commit 35d6b0f

Please sign in to comment.