Skip to content

Commit

Permalink
fix: ts plugin prior diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN authored and plantain-00 committed Aug 22, 2024
1 parent 4e20c97 commit 1c6af3b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ function init(modules: { typescript: typeof tsserverlibrary }) {
...info.languageService,
getSemanticDiagnostics(fileName) {
const config: { jsEnable: boolean } = info.config
const prior = info.languageService.getSemanticDiagnostics(fileName);
if (!config?.jsEnable && (fileName.endsWith('.js') || fileName.endsWith('.jsx'))) {
return []
return [...prior]
}
const result = lintSync(
info.project.getCompilerOptions(),
Expand All @@ -22,7 +23,7 @@ function init(modules: { typescript: typeof tsserverlibrary }) {
},
)
oldProgram = result.program
const diagnostics: tsserverlibrary.Diagnostic[] = []
const diagnostics: tsserverlibrary.Diagnostic[] = [...prior]
for (const anyObject of result.anys) {
let messageText: string
if (anyObject.kind === FileAnyInfoKind.containsAny) {
Expand Down

0 comments on commit 1c6af3b

Please sign in to comment.