-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps): bump vue and TS versions
- Loading branch information
Showing
4 changed files
with
871 additions
and
771 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { generateCodeFrame, CompilerError } from '@vue/compiler-sfc' | ||
import chalk from 'chalk' | ||
|
||
export function formatError(err: CompilerError, source: string, file: string) { | ||
if (err.loc) { | ||
const loc = `:${err.loc.start.line}:${err.loc.start.column}` | ||
const filePath = chalk.gray(`at ${file}${loc}`) | ||
const codeframe = generateCodeFrame( | ||
source, | ||
err.loc.start.offset, | ||
err.loc.end.offset | ||
) | ||
err.message = `\n${chalk.red( | ||
`VueCompilerError: ${err.message}` | ||
)}\n${filePath}\n${chalk.yellow(codeframe)}\n` | ||
export function formatError( | ||
err: SyntaxError | CompilerError, | ||
source: string, | ||
file: string | ||
) { | ||
const loc = (err as CompilerError).loc | ||
if (!loc) { | ||
return | ||
} | ||
const locString = `:${loc.start.line}:${loc.start.column}` | ||
const filePath = chalk.gray(`at ${file}${locString}`) | ||
const codeframe = generateCodeFrame(source, loc.start.offset, loc.end.offset) | ||
err.message = `\n${chalk.red( | ||
`VueCompilerError: ${err.message}` | ||
)}\n${filePath}\n${chalk.yellow(codeframe)}\n` | ||
} |
Oops, something went wrong.