Skip to content

Commit

Permalink
fix: clean output by Vite hmr console clear
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jul 3, 2021
1 parent 2bb6cbd commit b30ca51
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 111 deletions.
4 changes: 0 additions & 4 deletions packages/vite-plugin-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,11 @@
"lodash.omit": "^4.5.0",
"lodash.pick": "^4.4.0",
"npm-run-path": "^4.0.1",
"slice-ansi": "^4.0.0",
"strip-ansi": "^6.0.0",
"tiny-invariant": "^1.1.0",
"vscode-languageclient": "^7.0.0"
},
"peerDependencies": {
"vite": "^2.0.0"
},
"devDependencies": {
"@types/slice-ansi": "^4.0.0"
}
}
10 changes: 5 additions & 5 deletions packages/vite-plugin-checker/src/checkers/tsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ const createDiagnostic: CreateDiagnostic<Pick<PluginConfig, 'typescript'>> = (ch
errorCount
// eslint-disable-next-line max-params
) => {
// https://github.com/microsoft/TypeScript/blob/dc237b317ed4bbccd043ddda802ffde00362a387/src/compiler/diagnosticMessages.json#L4086-L4088
if (diagnostic.code === 6031) return

// https://github.com/microsoft/TypeScript/issues/32542
// https://github.com/microsoft/TypeScript/blob/dc237b317ed4bbccd043ddda802ffde00362a387/src/compiler/diagnosticMessages.json#L4086-L4088
switch (diagnostic.code) {
case 6032: // Incremental build
case 6031:
case 6032:
// clear current error and use the newer errors
currErr = null
break
case 6031: // Initial build
return
case 6193: // 1 Error
case 6194: // 0 errors or 2+ errors
if (currErr && overlay) {
Expand All @@ -93,6 +92,7 @@ const createDiagnostic: CreateDiagnostic<Pick<PluginConfig, 'typescript'>> = (ch
})
}
}

ensureCall(() => {
const diagnosticMessage = os.EOL + os.EOL + diagnostic.messageText.toString()
logChunk.message = diagnosticMessage
Expand Down
92 changes: 0 additions & 92 deletions packages/vite-plugin-checker/src/logger.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/vite-plugin-checker/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './types'
export * from './codeFrame'
export * from './utils'
export * from './worker'
export * as logger from './logger'

const sharedConfigKeys: (keyof SharedConfig)[] = ['enableBuild', 'overlay']
const buildInCheckerKeys: (keyof BuildInCheckers)[] = ['typescript', 'vueTsc']
Expand Down
9 changes: 0 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b30ca51

Please sign in to comment.