Skip to content

Commit 9285284

Browse files
committed
chore: broken typechecking and linting
1 parent 3c46cff commit 9285284

14 files changed

+23
-15
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default createConfigForNuxt({
1313
})
1414
.override('nuxt/typescript/rules', {
1515
rules: {
16+
'@typescript-eslint/no-empty-object-type': ['off'],
1617
'@typescript-eslint/ban-ts-comment': [
1718
'error',
1819
{

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@
4848
"lint": "eslint .",
4949
"lint:fix": "eslint . --fix",
5050
"test": "vitest",
51-
"test:types": "npx nuxi typecheck",
51+
"test:types": "echo 'broken due to type regeneration, use pnpm typecheck' && npx nuxi typecheck",
5252
"script:generate-tpc": "bun ./scripts/generateTpcScripts.ts && pnpm lint:fix"
5353
},
5454
"build": {
5555
"externals": [
5656
"@unhead/vue",
5757
"@unhead/schema",
58-
"#nuxt-scripts",
59-
"#nuxt-scripts-validator",
6058
"third-party-capital",
6159
"knitwork",
6260
"estree-walker",

src/module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ export default defineNuxtModule<ModuleOptions>({
9292
async setup(config, nuxt) {
9393
const { resolve } = createResolver(import.meta.url)
9494
const { version, name } = await readPackageJSON(resolve('../package.json'))
95+
nuxt.options.alias['#nuxt-scripts-validator'] = resolve(`./runtime/validation/${(nuxt.options.dev || nuxt.options._prepare) ? 'valibot' : 'mock'}`)
96+
nuxt.options.alias['#nuxt-scripts'] = resolve('./runtime/types')
97+
nuxt.options.alias['#nuxt-scripts-utils'] = resolve('./runtime/utils')
9598
if (!config.enabled) {
9699
// TODO fallback to useHead?
97100
logger.debug('The module is disabled, skipping setup.')

src/runtime/registry/clarity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface ClarityApi {
3333
}
3434

3535
declare global {
36-
type Window = ClarityApi
36+
interface Window extends ClarityApi {}
3737
}
3838

3939
export const ClarityOptions = object({

src/runtime/registry/cloudflare-web-analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface CloudflareWebAnalyticsApi {
1818
}
1919

2020
declare global {
21-
type Window = CloudflareWebAnalyticsApi
21+
interface Window extends CloudflareWebAnalyticsApi {}
2222
}
2323

2424
export const CloudflareWebAnalyticsOptions = object({

src/runtime/registry/google-adsense.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface GoogleAdsenseApi {
2121
}
2222

2323
declare global {
24-
type Window = GoogleAdsenseApi
24+
interface Window extends GoogleAdsenseApi {}
2525
}
2626

2727
/**

src/runtime/registry/google-maps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useRegistryScript } from '../utils'
44
import { array, literal, object, optional, string, union } from '#nuxt-scripts-validator'
55
import type { RegistryScriptInput } from '#nuxt-scripts'
66

7-
// eslint-disable-next-line @typescript-eslint/no-namespace
7+
// eslint-disable-next-line
88
declare namespace google {
99
// eslint-disable-next-line @typescript-eslint/no-namespace
1010
export namespace maps {
@@ -23,7 +23,7 @@ export const GoogleMapsOptions = object({
2323

2424
export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>
2525

26-
type MapsNamespace = google.maps
26+
type MapsNamespace = typeof google.maps
2727
export interface GoogleMapsApi {
2828
maps: MapsNamespace | Promise<MapsNamespace>
2929
}

src/runtime/registry/google-tag-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { RegistryScriptInput } from '#nuxt-scripts'
66
import { object, string, optional } from '#nuxt-scripts-validator'
77

88
declare global {
9-
type Window = GoogleTagManagerApi
9+
interface Window extends GoogleTagManagerApi {}
1010
}
1111
export const GoogleTagManagerOptions = object({
1212
id: string(),

src/runtime/registry/matomo-analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface MatomoAnalyticsApi {
1717
}
1818

1919
declare global {
20-
type Window = MatomoAnalyticsApi
20+
interface Window extends MatomoAnalyticsApi {}
2121
}
2222

2323
export function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput) {

src/runtime/registry/meta-pixel.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ export interface MetaPixelApi {
2929
queue: any[]
3030
}
3131
_fbq: MetaPixelApi['fbq']
32+
callMethod?: FbqFns
3233
}
3334

3435
declare global {
35-
type Window = MetaPixelApi
36+
interface Window extends MetaPixelApi {}
3637
}
3738

3839
export const MetaPixelOptions = object({
@@ -56,7 +57,9 @@ export function useScriptMetaPixel<T extends MetaPixelApi>(_options?: MetaPixelI
5657
? undefined
5758
: () => {
5859
const fbq: MetaPixelApi['fbq'] = window.fbq = function (...params: any[]) {
60+
// @ts-expect-error untypeds
5961
if (fbq.callMethod) {
62+
// @ts-expect-error untyped
6063
fbq.callMethod(...params)
6164
}
6265
else {

0 commit comments

Comments
 (0)