From 046702eb2f74ca0d898b89994be86a44f4d240bf Mon Sep 17 00:00:00 2001 From: Alex Kanunnikov Date: Thu, 29 May 2025 22:44:36 +0300 Subject: [PATCH] fix: possible default export for template-lint --- src/template-linter.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/template-linter.ts b/src/template-linter.ts index 4e38da6a..ff2efde5 100644 --- a/src/template-linter.ts +++ b/src/template-linter.ts @@ -189,7 +189,7 @@ export default class TemplateLinter { return; } - const TemplateLinterKlass = await this.getLinter(project); + const TemplateLinterKlass = await this.linterForProject(project); if (!TemplateLinterKlass) { return; @@ -275,10 +275,18 @@ export default class TemplateLinter { } // eslint-disable-next-line @typescript-eslint/explicit-function-return-type public async linterForProject(project: Project) { - return await this.getLinter(project); + const maybeLinter = await this.getLinter(project); + + if (!maybeLinter) { + return; + } else if ('default' in maybeLinter) { + return maybeLinter.default; + } else { + return maybeLinter; + } } // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - private async getLinter(project: Project): Promise { + private async getLinter(project: Project): Promise { if (this._linterCache.has(project)) { return this._linterCache.get(project); }