fix(docblock-generator): eslint errors + missing await (#7281)
* chore: add missing await in docblock generator * add fix for undefined symbol * fix dirname path
This commit is contained in:
@@ -106,7 +106,10 @@ class Formatter {
|
||||
|
||||
this.eslintConfig = (
|
||||
await import(
|
||||
path.relative(dirname(), path.join(this.cwd, ".eslintrc.js"))
|
||||
path.relative(
|
||||
dirname(import.meta.url),
|
||||
path.join(this.cwd, ".eslintrc.js")
|
||||
)
|
||||
)
|
||||
).default as Linter.Config
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ class DefaultKindGenerator<T extends ts.Node = ts.Node> {
|
||||
}
|
||||
|
||||
if (
|
||||
symbolType.symbol.valueDeclaration &&
|
||||
symbolType.symbol?.valueDeclaration &&
|
||||
"heritageClauses" in symbolType.symbol.valueDeclaration
|
||||
) {
|
||||
return this.isEntity({
|
||||
|
||||
@@ -40,7 +40,7 @@ export default async function runGitChanges({
|
||||
...options,
|
||||
})
|
||||
|
||||
oasGenerator.run()
|
||||
await oasGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${files.length} files.`)
|
||||
|
||||
@@ -48,7 +48,7 @@ export default async function (
|
||||
...options,
|
||||
})
|
||||
|
||||
oasGenerator.run()
|
||||
await oasGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${filteredFiles.length} files.`)
|
||||
|
||||
@@ -46,7 +46,7 @@ export default async function ({ type, tag, ...options }: CommonCliOptions) {
|
||||
...options,
|
||||
})
|
||||
|
||||
oasGenerator.run()
|
||||
await oasGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${filteredFiles.length} files.`)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import path from "path"
|
||||
import { fileURLToPath } from "url"
|
||||
|
||||
export default function dirname() {
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
export default function dirname(fileUrl: string) {
|
||||
const __filename = fileURLToPath(fileUrl)
|
||||
|
||||
return path.dirname(__filename)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ import dirname from "./dirname.js"
|
||||
export default function getMonorepoRoot() {
|
||||
return (
|
||||
process.env.MONOREPO_ROOT_PATH ||
|
||||
path.join(dirname(), "..", "..", "..", "..", "..", "..")
|
||||
path.join(dirname(import.meta.url), "..", "..", "..", "..", "..", "..")
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user