Skip to content

Commit

Permalink
test: add additional test for validity of types shared from runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 22, 2024
1 parent 633e51c commit afc4374
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion example/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export default defineNuxtConfig({
api: '',
},
hooks: {
'my-module:init'() {},
'my-module:init'(sharedType) {
// @ts-expect-error invalid assignment
const b: number = sharedType

Check failure on line 11 in example/playground/nuxt.config.ts

View workflow job for this annotation

GitHub Actions / ci

'b' is assigned a value but never used. Allowed unused vars must match /^_/u
},
},
})
2 changes: 1 addition & 1 deletion example/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ModuleOptions {
}

export interface ModuleHooks {
'my-module:init': () => void
'my-module:init': (sharedType: SharedTypeFromRuntime) => void
}

export interface ModuleRuntimeHooks {
Expand Down

0 comments on commit afc4374

Please sign in to comment.