-
-
Notifications
You must be signed in to change notification settings - Fork 885
Closed
Labels
C-bugCategory - BugCategory - Bug
Description
After #7724, produced errors became less useful since they don't contain a reference to the problematic spot in a source file. Example:
const oxc = require('oxc-transform')
const source = `
export const sum = (a: number, b: number): number => a + b
export const subtract = (a: number, b: number) => a - b
`
const {errors} = oxc.isolatedDeclaration('example.ts', source)
console.log(errors)oxc-transform@0.39.0
[
'\n' +
' x TS9007: Function must have an explicit return type annotation with\n' +
' | --isolatedDeclarations.\n' +
' ,-[example.ts:4:29]\n' +
' 3 | \n' +
' 4 | export const subtract = (a: number, b: number) => a - b\n' +
' : ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
' `----\n'
]
oxc-transform@0.40.0 and later versions
[
{
severity: 'Error',
message: 'TS9007: Function must have an explicit return type annotation with --isolatedDeclarations.',
labels: [ [ { start: 93, end: 120 } ] ]
}
]
It would be super helpful to have the location specifier back. Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory - BugCategory - Bug