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 authored and GitHub committed 2024-05-09 17:23:59 +03:00
1 parent 5d0ffe8ff4
commit 489a54e1fb
7 files changed
+11 -8

No files matched your search

@@ -106,7 +106,10 @@ class Formatter {
this.eslintConfig = ( this.eslintConfig = (
await import( 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 ).default as Linter.Config
@@ -474,7 +474,7 @@ class DefaultKindGenerator<T extends ts.Node = ts.Node> {
} }
if ( if (
symbolType.symbol.valueDeclaration && symbolType.symbol?.valueDeclaration &&
"heritageClauses" in symbolType.symbol.valueDeclaration "heritageClauses" in symbolType.symbol.valueDeclaration
) { ) {
return this.isEntity({ return this.isEntity({
@@ -40,7 +40,7 @@ export default async function runGitChanges({
...options, ...options,
}) })
oasGenerator.run() await oasGenerator.run()
} }
console.log(`Finished generating docs for ${files.length} files.`) console.log(`Finished generating docs for ${files.length} files.`)
@@ -48,7 +48,7 @@ export default async function (
...options, ...options,
}) })
oasGenerator.run() await oasGenerator.run()
} }
console.log(`Finished generating docs for ${filteredFiles.length} files.`) console.log(`Finished generating docs for ${filteredFiles.length} files.`)
@@ -46,7 +46,7 @@ export default async function ({ type, tag, ...options }: CommonCliOptions) {
...options, ...options,
}) })
oasGenerator.run() await oasGenerator.run()
} }
console.log(`Finished generating docs for ${filteredFiles.length} files.`) console.log(`Finished generating docs for ${filteredFiles.length} files.`)
@@ -1,8 +1,8 @@
import path from "path" import path from "path"
import { fileURLToPath } from "url" import { fileURLToPath } from "url"
export default function dirname() { export default function dirname(fileUrl: string) {
const __filename = fileURLToPath(import.meta.url) const __filename = fileURLToPath(fileUrl)
return path.dirname(__filename) return path.dirname(__filename)
} }
@@ -10,6 +10,6 @@ import dirname from "./dirname.js"
export default function getMonorepoRoot() { export default function getMonorepoRoot() {
return ( return (
process.env.MONOREPO_ROOT_PATH || process.env.MONOREPO_ROOT_PATH ||
path.join(dirname(), "..", "..", "..", "..", "..", "..") path.join(dirname(import.meta.url), "..", "..", "..", "..", "..", "..")
) )
} }