Skip to content

Commit

Permalink
fix(core): access syntaxOnlyLanguageService via question dot
Browse files Browse the repository at this point in the history
close #34
  • Loading branch information
johnsoncodehk committed Dec 16, 2024
1 parent e8f0b02 commit 8f27274
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function createLinter(
ctx: ProjectContext,
config: Config | Config[],
mode: 'cli' | 'typescript-plugin',
syntaxOnlyLanguageService?: ts.LanguageService
syntaxOnlyLanguageService?: ts.LanguageService & {
getNonBoundSourceFile?(fileName: string): ts.SourceFile;
}
) {
const ts = ctx.typescript;
const fileRules = new Map<string, Record<string, Rule>>();
Expand Down Expand Up @@ -53,7 +55,7 @@ export function createLinter(
}));
const normalizedPath = new Map<string, string>();
const rule2Mode = new Map<string, /* typeAwareMode */ boolean>();
const getNonBoundSourceFile: ((fileName: string) => ts.SourceFile) | undefined = (syntaxOnlyLanguageService as any).getNonBoundSourceFile;
const getNonBoundSourceFile = syntaxOnlyLanguageService?.getNonBoundSourceFile;

let shouldEnableTypeAware = false;

Expand Down

0 comments on commit 8f27274

Please sign in to comment.