Skip to content

Commit

Permalink
Merge pull request #206 from JHWelch/more-linting
Browse files Browse the repository at this point in the history
More linting
  • Loading branch information
JHWelch authored Oct 31, 2024
2 parents 7af8333 + ef98da0 commit b1e545e
Show file tree
Hide file tree
Showing 25 changed files with 234 additions and 215 deletions.
2 changes: 1 addition & 1 deletion client/src/__tests__/test-extensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'vitest'

declare module '@vue/test-utils' {
interface VueWrapper {
byTestId(id: string): DOMWrapper<Element>;
byTestId(id: string): DOMWrapper<Element>
}
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/components/DynamicHeroIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { onMounted, ref } from 'vue'
import * as heroIcons from '@heroicons/vue/24/solid'
const props = defineProps<{
name: keyof typeof heroIcons,
class?: string,
name: keyof typeof heroIcons
class?: string
}>()
const isLoaded = ref(false)
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/RsvpModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { CalendarDaysIcon } from '@heroicons/vue/24/solid'
import { jsonHeaders } from '@client/data/headers'
type RsvpForm = {
name: string,
email?: string,
reminders: boolean,
name: string
email?: string
reminders: boolean
}
const errors = ref<Errors>({})
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/form/FormCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { computed } from 'vue'
const props = defineProps<{
name: string,
description: string,
label?: string,
name: string
description: string
label?: string
}>()
defineEmits([
Expand Down
14 changes: 7 additions & 7 deletions client/src/components/form/FormInput.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts" setup>
withDefaults(defineProps<{
name: string,
hideLabel?: boolean,
label?: string,
type?: string,
error?: string,
placeholder?: string,
required?: boolean,
name: string
hideLabel?: boolean
label?: string
type?: string
error?: string
placeholder?: string
required?: boolean
}>(), {
hideLabel: false,
type: 'text',
Expand Down
8 changes: 4 additions & 4 deletions client/src/pages/SuggestionsCreatePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { ErrorBag } from '@client/types'
import { jsonHeaders } from '@client/data/headers'
type SuggestionFormData = {
theme?: string,
submitted_by?: string,
movie1?: string,
movie2?: string,
theme?: string
submitted_by?: string
movie1?: string
movie2?: string
}
const errors = ref<SuggestionFormData>({})
Expand Down
6 changes: 3 additions & 3 deletions client/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type Errors = {
[key: string]: string;
[key: string]: string
}

export type ErrorBag = {
errors?: Errors;
message?: string;
errors?: Errors
message?: string
}
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,22 @@ export default [
'no-restricted-imports': ['error', {
patterns: ['.*'], // Disable all relative imports
}],
'@stylistic/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
],
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none',
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
multilineDetection: 'brackets',
},
],
},
}]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let req: Request
const newCacheController = () => {
const config = mockConfig()
const firestore = new FirestoreAdapter(config)

return new CacheEmailTemplatesController(firestore)
}

Expand Down
6 changes: 3 additions & 3 deletions server/__tests__/controllers/rsvpController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const mockBody = ({
email = 'test@example.com',
reminders = false,
}: {
name?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
email?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
reminders?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
name?: any // eslint-disable-line @typescript-eslint/no-explicit-any
email?: any // eslint-disable-line @typescript-eslint/no-explicit-any
reminders?: any // eslint-disable-line @typescript-eslint/no-explicit-any
} = {}) => ({ name, email, reminders })

describe('store', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ beforeEach(() => {
})

interface MockBodyArgs {
email?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
email?: any // eslint-disable-line @typescript-eslint/no-explicit-any
}

const mockBody = ({
Expand Down
6 changes: 3 additions & 3 deletions server/__tests__/controllers/suggestionController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const newSuggestionController = () => {
}

interface MockBodyArgs {
theme?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
submitted_by?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
movies?: any; // eslint-disable-line @typescript-eslint/no-explicit-any
theme?: any // eslint-disable-line @typescript-eslint/no-explicit-any
submitted_by?: any // eslint-disable-line @typescript-eslint/no-explicit-any
movies?: any // eslint-disable-line @typescript-eslint/no-explicit-any
}

const mockBody = ({
Expand Down
64 changes: 32 additions & 32 deletions server/__tests__/support/firebaseMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,52 +115,52 @@ export class FirebaseMock {
}).toFirebaseDTO()

static mockCollection = (collectionPath: string): {
firestore: { firestore: 'firestore' },
collectionPath: string,
firestore: { firestore: 'firestore' }
collectionPath: string
} => ({
firestore: { firestore: 'firestore' },
collectionPath,
})
}

export type FirebaseWeek = {
id: string,
theme: string,
date: DateTime,
slug?: string | null,
isSkipped: boolean,
movies?: FirebaseMovie[],
styledTheme?: RichText[],
lastEditedTime?: string,
id: string
theme: string
date: DateTime
slug?: string | null
isSkipped: boolean
movies?: FirebaseMovie[]
styledTheme?: RichText[]
lastEditedTime?: string
}

export type FirebaseMovie = {
director: string,
length: number,
notionId: string,
posterPath: string,
showingUrl: string | null,
theaterName: string | null,
time: string | null,
title: string,
tmdbId: number | null,
url: string | null,
year: number | null,
director: string
length: number
notionId: string
posterPath: string
showingUrl: string | null
theaterName: string | null
time: string | null
title: string
tmdbId: number | null
url: string | null
year: number | null
}

export type FirebaseUser = {
id: string,
email: string,
reminders: boolean,
id: string
email: string
reminders: boolean
}

export type FirebaseWeekConstructor = {
id: string,
theme: string,
date: Date|string,
styledTheme?: RichText[],
isSkipped?: boolean,
slug?: string | null,
movies?: Movie[],
lastEditedTime?: DateTime|string,
id: string
theme: string
date: Date|string
styledTheme?: RichText[]
isSkipped?: boolean
slug?: string | null
movies?: Movie[]
lastEditedTime?: DateTime|string
}
Loading

0 comments on commit b1e545e

Please sign in to comment.