Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Sep 29, 2024
1 parent 7fea62d commit 0f9f906
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion crux-api/server/app/services/crux.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FetchError } from 'ofetch'
import { useRuntimeConfig } from '#imports'
import { $fetch } from 'ofetch'
import { withHttps, withTrailingSlash } from 'ufo'
import type { FetchError } from 'ofetch'

const cwvKeys = [
'largest_contentful_paint',
Expand Down
4 changes: 2 additions & 2 deletions docs/components/LighthouseThreeD.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import type { Group } from 'three'
import type { RendererPublicInterface } from 'troisjs'
import { useElementHover } from '@vueuse/core'
import { AmbientLight, Camera, FbxModel, PointLight, Renderer, Scene } from 'troisjs'
import { ref } from 'vue'
import type { Group } from 'three'
import type { RendererPublicInterface } from 'troisjs'
const rendererC = ref()
const lighthouseRef = ref()
Expand Down
2 changes: 1 addition & 1 deletion docs/components/OCodeBlock.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { BundledLanguage } from 'shiki'
import { useClipboard } from '@vueuse/core'
import { computed } from 'vue'
import type { BundledLanguage } from 'shiki'
import { loadShiki, renderCodeHighlight } from '../composables/shiki'
const props = withDefaults(
Expand Down
4 changes: 2 additions & 2 deletions docs/composables/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { MaybeRef } from '@vueuse/core'
import type { BundledLanguage, Highlighter } from 'shiki'
import { useColorMode } from '#imports'
import { getHighlighter } from 'shiki'
import { computed, ref, unref } from 'vue'
import type { MaybeRef } from '@vueuse/core'
import type { BundledLanguage, Highlighter } from 'shiki'

export const shiki = ref<Highlighter>()

Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/ci.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { UserConfig } from '@unlighthouse/core'
import type { ReporterConfig } from './reporters/types'
import type { CiOptions } from './types'
import { setMaxListeners } from 'node:events'
import { createUnlighthouse, generateClient, useLogger, useUnlighthouse } from '@unlighthouse/core'
import fs from 'fs-extra'
import { relative } from 'pathe'
import { isCI } from 'std-env'
import type { UserConfig } from '@unlighthouse/core'
import createCli from './createCli'
import { handleError } from './errors'
import { generateReportPayload, outputReport } from './reporters'
import { pickOptions, validateHost, validateOptions } from './util'
import type { ReporterConfig } from './reporters/types'
import type { CiOptions } from './types'

async function run() {
const startTime = new Date()
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { CliOptions } from './types'
import { setMaxListeners } from 'node:events'
import { createUnlighthouse, useLogger } from '@unlighthouse/core'
import { createServer } from '@unlighthouse/server'
import open from 'better-opn'
import createCli from './createCli'
import { pickOptions, validateHost, validateOptions } from './util'
import type { CliOptions } from './types'

const cli = createCli()

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/reporters/csvExpanded.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { get } from 'lodash-es'
import { csvSimpleFormat } from './csvSimple'
import type { UnlighthouseRouteReport } from '../types'
import type { ReporterConfig } from './types'
import { get } from 'lodash-es'
import { csvSimpleFormat } from './csvSimple'

export function reportCSVExpanded(reports: UnlighthouseRouteReport[], { columns }: ReporterConfig): string {
const { headers, body } = csvSimpleFormat(reports)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/reporters/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { ResolvedUserConfig, UnlighthouseRouteReport } from '@unlighthouse/core'
import type { ReporterConfig, ReportJsonExpanded, ReportJsonSimple } from './types'
import { join } from 'node:path'
import fse from 'fs-extra'
import type { ResolvedUserConfig, UnlighthouseRouteReport } from '@unlighthouse/core'
import { reportCSVExpanded } from './csvExpanded'
import { reportCSVSimple } from './csvSimple'
import { reportJsonExpanded } from './jsonExpanded'
import { reportJsonSimple } from './jsonSimple'
import { reportLighthouseServer } from './lighthouseServer'
import type { ReporterConfig, ReportJsonExpanded, ReportJsonSimple } from './types'

export function generateReportPayload(reporter: 'lighthouseServer', reports: UnlighthouseRouteReport[], config?: ReporterConfig): Promise<void>
export function generateReportPayload(reporter: 'jsonExpanded', reports: UnlighthouseRouteReport[]): ReportJsonExpanded
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/reporters/lighthouseServer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { UnlighthouseRouteReport } from '../types'
import type { ReporterConfig } from './types'
import ApiClient from '@lhci/utils/src/api-client.js'
import {
getAncestorHash,
Expand All @@ -11,8 +13,6 @@ import {
} from '@lhci/utils/src/build-context.js'
import fs from 'fs-extra'
import { handleError } from '../errors'
import type { UnlighthouseRouteReport } from '../types'
import type { ReporterConfig } from './types'

export async function reportLighthouseServer(
reports: UnlighthouseRouteReport[],
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ResolvedUserConfig, UserConfig } from '@unlighthouse/core'
import type { CiOptions, CliOptions } from './types'
import { URL } from 'node:url'
import { fetchUrlRaw, normaliseHost, useLogger } from '@unlighthouse/core'
import { defu } from 'defu'
import { pick } from 'lodash-es'
import type { ResolvedUserConfig, UserConfig } from '@unlighthouse/core'
import { handleError } from './errors'
import type { CiOptions, CliOptions } from './types'

export async function validateHost(resolvedConfig: ResolvedUserConfig) {
const site = resolvedConfig.site
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/csv-reports.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { UnlighthouseRouteReport } from '../src/types'
import { describe, expect, it } from 'vitest'
import { DefaultColumns } from '../../core/src/constants'
import { generateReportPayload } from '../src/reporters'
import _lighthouseReport from './__fixtures__/lighthouseReport.mjs'
import type { UnlighthouseRouteReport } from '../src/types'

const lighthouseReport = _lighthouseReport as any as UnlighthouseRouteReport[]

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/json-reports.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { UnlighthouseRouteReport } from '../src/types'
import { describe, expect, it } from 'vitest'
import { generateReportPayload } from '../src/reporters'
import _lighthouseReport from './__fixtures__/lighthouseReport.mjs'
import type { UnlighthouseRouteReport } from '../src/types'

const lighthouseReport = _lighthouseReport as any as UnlighthouseRouteReport[]

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/lighthouseServer-reports.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { UnlighthouseRouteReport } from '../src/types'
import ApiClient from '@lhci/utils/src/api-client.js'
import fs from 'fs-extra'
import { describe, expect, it, vi } from 'vitest'
import { generateReportPayload } from '../src/reporters'
import _lighthouseReport from './__fixtures__/lighthouseReport.mjs'
import type { UnlighthouseRouteReport } from '../src/types'

const lighthouseReport = _lighthouseReport as any as UnlighthouseRouteReport[]

Expand Down
2 changes: 1 addition & 1 deletion packages/client/components/Cell/CellImage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { $URL, withBase } from 'ufo'
import type { UnlighthouseColumn, UnlighthouseRouteReport } from '@unlighthouse/core'
import { $URL, withBase } from 'ufo'
import { iframeModalUrl, isModalOpen, isOffline, website } from '../../logic'
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion packages/client/components/Cell/CellImageIssues.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { sum } from 'lodash-es'
import type { UnlighthouseColumn, UnlighthouseRouteReport } from '@unlighthouse/core'
import { sum } from 'lodash-es'
const props = defineProps<{
report: UnlighthouseRouteReport
Expand Down
2 changes: 1 addition & 1 deletion packages/client/components/Cell/CellMetaDescription.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { get } from 'lodash-es'
import type { UnlighthouseColumn, UnlighthouseRouteReport } from '@unlighthouse/core'
import { get } from 'lodash-es'
const props = defineProps<{
report: UnlighthouseRouteReport
Expand Down
2 changes: 1 addition & 1 deletion packages/client/components/Cell/CellNetworkRequests.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { get, groupBy, sum } from 'lodash-es'
import type { UnlighthouseColumn, UnlighthouseRouteReport } from '@unlighthouse/core'
import { get, groupBy, sum } from 'lodash-es'
import { formatBytes, website } from '../../logic'
const props = defineProps<{
Expand Down
4 changes: 2 additions & 2 deletions packages/client/components/LighthouseThreeD.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import type { Group } from 'three'
import type { RendererPublicInterface } from 'troisjs'
import { useElementHover } from '@vueuse/core'
import { AmbientLight, Camera, FbxModel, PointLight, Renderer, Scene } from 'troisjs'
import { ref } from 'vue'
import type { Group } from 'three'
import type { RendererPublicInterface } from 'troisjs'
import { basePath, scanMeta } from '../logic'
const rendererC = ref()
Expand Down
2 changes: 1 addition & 1 deletion packages/client/components/Results/ResultsCell.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { get } from 'lodash-es'
import type { UnlighthouseColumn, UnlighthouseRouteReport } from '@unlighthouse/core'
import { get } from 'lodash-es'
const props = defineProps<{
report: UnlighthouseRouteReport
Expand Down
2 changes: 1 addition & 1 deletion packages/client/logic/search.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { UnlighthouseRouteReport, UnlighthouseTaskStatus } from '@unlighthouse/core'
import { useStorage } from '@vueuse/core'
import Fuse from 'fuse.js'
import { get, isEmpty, orderBy } from 'lodash-es'
import { computed } from 'vue'
import type { UnlighthouseRouteReport, UnlighthouseTaskStatus } from '@unlighthouse/core'
import { unlighthouseReports } from './state'
import { columns, groupRoutesKey } from './static'

Expand Down
2 changes: 1 addition & 1 deletion packages/client/logic/state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NormalisedRoute, ScanMeta, UnlighthouseRouteReport } from '@unlighthouse/core'
import { sum } from 'lodash-es'
import { computed, reactive } from 'vue'
import type { NormalisedRoute, ScanMeta, UnlighthouseRouteReport } from '@unlighthouse/core'
import CellRouteName from '../components/Cell/CellRouteName.vue'
import CellScoreSingle from '../components/Cell/CellScoreSingle.vue'
import CellScoresOverview from '../components/Cell/CellScoresOverview.vue'
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AliasOptions } from 'vite'
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import type { AliasOptions } from 'vite'

const r = (p: string) => resolve(__dirname, p)

Expand Down

0 comments on commit 0f9f906

Please sign in to comment.