Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: APPS-3062 Fix eslint errors reported on Github PR #102

Merged
merged 12 commits into from
Feb 5, 2025
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_modules/
storybook-static/
.output
dist

13 changes: 9 additions & 4 deletions composables/useContentIndexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export function useContentIndexer() {
async function indexContent(data, slug) {
try {
if (data && slug && esIndex) {
/* console.log(
"this is the elasticsearch plugin: " + JSON.stringify(data)
) */
// console.log(`Requesting URL: ${esURL}/${esIndex}/_doc/${slug}`)
// eslint-disable-next-line no-console
console.log(
'this is the elasticsearch plugin: ' + JSON.stringify(data)
)
// eslint-disable-next-line no-console
console.log(`Requesting URL: ${esURL}/${esIndex}/_doc/${slug}`)
const docExists = await fetch(
`${esURL}/${esIndex}/_doc/${slug}`,
{
Expand Down Expand Up @@ -62,10 +64,13 @@ export function useContentIndexer() {
// console.log('Create a new document in ES:', await response.text())
}
} else {
// eslint-disable-next-line no-console
console.warn('not indexing anything')
}
} catch (e) {
// eslint-disable-next-line no-console
console.error('skip indexing if connection times out during builds in the mean time: ' + e.message)
// eslint-disable-next-line no-console
console.warn('skip indexing if connection times out during builds in the mean time: ' + e.message)
throw new Error('Elastic Search Indexing failed ' + e) // TODO uncomment when cause is clear
}
Expand Down
13 changes: 7 additions & 6 deletions error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import { SectionWrapper } from 'ucla-library-website-components'

const props = defineProps({
error: Object as () => NuxtError
error: {
type: Object as () => NuxtError,
default: () => ({ statusCode: 500, message: 'An unexpected error occurred' }),
},
})
const isDevelopment = computed(() => import.meta.dev)

const isDevelopment = computed(() => import.meta.dev)
</script>

<template>
Expand Down Expand Up @@ -52,10 +55,8 @@

<divider-way-finder />

<rich-text
class="
error-text"
>
<rich-text class="

Check warning on line 58 in error.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected a linebreak before this attribute
error-text">

Check warning on line 59 in error.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected 1 line break before closing bracket, but no line breaks found
<h1
v-if="error?.statusCode === 404"
class="error-title"
Expand Down
2 changes: 2 additions & 0 deletions modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default defineNuxtModule({
// console.log('Index created:' + JSON.stringify(testJson))
// console.log('Elastic Search index created succesfully!')
} catch (err) {
// eslint-disable-next-line no-console
console.error('Error:', err)
// eslint-disable-next-line no-console
console.error('Response body:', body)
throw err
}
Expand Down
6 changes: 2 additions & 4 deletions pages/blog/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// UTILS
import removeTags from '~/utils/removeTags'
import socialList from '~/utils/socialList'

Check warning on line 20 in pages/blog/[slug].vue

View workflow job for this annotation

GitHub Actions / eslint

Using exported name 'socialList' as identifier for default import

const { $graphql } = useNuxtApp()

Expand Down Expand Up @@ -51,6 +51,7 @@
await indexContent(data.value.ftvaArticle, route.params.slug)
// console.log('Article indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX ARTICLE during static build:', error)
}
}
Expand Down Expand Up @@ -228,10 +229,7 @@
</main>
</template>

<style
lang="scss"
scoped
>
<style lang="scss" scoped>
// PAGE STYLES
.page-article-detail {
position: relative;
Expand Down
1 change: 1 addition & 0 deletions pages/collections/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// UTILS
import removeTags from '~/utils/removeTags'
import socialList from '~/utils/socialList'

Check warning on line 18 in pages/collections/[slug].vue

View workflow job for this annotation

GitHub Actions / eslint

Using exported name 'socialList' as identifier for default import

const { $graphql } = useNuxtApp()

Expand Down Expand Up @@ -50,6 +50,7 @@
await indexContent(data.value.ftvaCollection, route.params.slug)
// console.log('Collection indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX COLLECTION during static build:', error)
}
}
Expand Down
1 change: 1 addition & 0 deletions pages/collections/la-rebellion/filmmakers/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ if (data.value.ftvaLARebellionIndividual && import.meta.prerender) {
await indexContent(data.value.ftvaLARebellionIndividual, route.params.slug)
// console.log('Event indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX EVENT during static build:', error)
}
}
Expand Down
1 change: 1 addition & 0 deletions pages/collections/la-rebellion/filmmakers/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ if (data.value.entry && import.meta.prerender) {

// console.log('Article indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX ARTICLES during static build:', error)
}
}
Expand Down
1 change: 1 addition & 0 deletions pages/events/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (data.value.ftvaEvent && import.meta.prerender) {
await indexContent(data.value.ftvaEvent, route.params.slug)
// console.log('Event indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX EVENT during static build:', error)
}
}
Expand Down
1 change: 1 addition & 0 deletions pages/events/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ async function searchES() {
hasMore.value = false
}
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error fetching data:', error)
hasMore.value = false
} finally {
Expand Down
1 change: 1 addition & 0 deletions pages/series/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (data.value.ftvaEventSeries && import.meta.prerender) {
await indexContent(data.value.ftvaEventSeries, route.params.slug)
// console.log('Event series indexed successfully during static build')
} catch (error) {
// eslint-disable-next-line no-console
console.error('FAILED TO INDEX EVENT SERIES during static build:', error)
}
}
Expand Down
3 changes: 3 additions & 0 deletions plugins/indexer.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ export default defineNuxtPlugin((nuxtApp) => {
// console.log('Create a new document in ES:', await response.text())
}
} else {
// eslint-disable-next-line no-console
console.warn('not indexing anything')
}
} catch (e) {
// eslint-disable-next-line no-console
console.error('skip indexing if connection times out during builds in the mean time: ' + e.message)
// eslint-disable-next-line no-console
console.warn('skip indexing if connection times out during builds in the mean time: ' + e.message)
throw new Error('Elastic Search Indexing failed ' + e) // TODO uncomment when cause is clear
}
Expand Down
Loading