Skip to content

Commit ab74efd

Browse files
committed
fix: include eslint-typegen.d.ts in nuxt.node.d.ts, close #596
1 parent 874f62e commit ab74efd

File tree

1 file changed

+4
-2
lines changed
  • packages/module/src/modules/config

1 file changed

+4
-2
lines changed

‎packages/module/src/modules/config/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dirname } from 'node:path'
1+
import { dirname, join } from 'node:path'
22
import fs from 'node:fs/promises'
33
import type { Nuxt } from '@nuxt/schema'
44
import type { ESLintConfigGenAddon } from '../../types'
@@ -17,8 +17,10 @@ export async function setupConfigGen(options: ModuleOptions, nuxt: Nuxt) {
1717
createAddonGlobals(nuxt),
1818
]
1919

20-
nuxt.hook('prepare:types', ({ declarations }) => {
20+
nuxt.hook('prepare:types', ({ declarations, nodeReferences }) => {
2121
declarations.push('/// <reference path="./eslint-typegen.d.ts" />')
22+
if (nodeReferences)
23+
nodeReferences.push({ path: join(nuxt.options.buildDir, 'eslint-typegen.d.ts') })
2224
})
2325

2426
let _configFile: string = undefined!

0 commit comments

Comments
 (0)