Skip to content

Commit 3684c0a

Browse files
committed
fix: report semantic before type checking
#129
1 parent 4525b92 commit 3684c0a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/core/src/core.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ export async function lint(project: string, options?: Partial<LintOptions>) {
131131
ignoreEmptyType: lintOptions.ignoreEmptyType,
132132
}
133133

134-
sourceFile.forEachChild(node => {
135-
checkNode(node, context)
136-
})
137-
138-
correctCount += context.typeCheckResult.correctCount
139-
totalCount += context.typeCheckResult.totalCount
140-
anys.push(...context.typeCheckResult.anys.map((a) => ({ file, ...a })))
141-
142134
if (lintOptions.reportSemanticError) {
143135
const diagnostics = program.getSemanticDiagnostics(sourceFile)
144136
for (const diagnostic of diagnostics) {
@@ -162,6 +154,14 @@ export async function lint(project: string, options?: Partial<LintOptions>) {
162154
}
163155
}
164156

157+
sourceFile.forEachChild(node => {
158+
checkNode(node, context)
159+
})
160+
161+
correctCount += context.typeCheckResult.correctCount
162+
totalCount += context.typeCheckResult.totalCount
163+
anys.push(...context.typeCheckResult.anys.map((a) => ({ file, ...a })))
164+
165165
if (lintOptions.fileCounts) {
166166
fileCounts.set(file, {
167167
correctCount: context.typeCheckResult.correctCount,

0 commit comments

Comments
 (0)