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:
Shahed Nasser
2024-05-09 17:23:59 +03:00
committed by GitHub
parent 5d0ffe8ff4
commit 489a54e1fb
7 changed files with 11 additions and 8 deletions

View File

@@ -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

View File

@@ -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({

View File

@@ -40,7 +40,7 @@ export default async function runGitChanges({
...options,
})
oasGenerator.run()
await oasGenerator.run()
}
console.log(`Finished generating docs for ${files.length} files.`)

View File

@@ -48,7 +48,7 @@ export default async function (
...options,
})
oasGenerator.run()
await oasGenerator.run()
}
console.log(`Finished generating docs for ${filteredFiles.length} files.`)

View File

@@ -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.`)

View File

@@ -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)
}

View File

@@ -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), "..", "..", "..", "..", "..", "..")
)
}