Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/template-linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class TemplateLinter {
return;
}

const TemplateLinterKlass = await this.getLinter(project);
const TemplateLinterKlass = await this.linterForProject(project);

if (!TemplateLinterKlass) {
return;
Expand Down Expand Up @@ -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<typeof Linter | undefined> {
private async getLinter(project: Project): Promise<typeof Linter | { default: typeof Linter } | undefined> {
if (this._linterCache.has(project)) {
return this._linterCache.get(project);
}
Expand Down
Loading