Skip to content

Commit 2e3d890

Browse files
author
Simon Hoss
committed
fix lint
1 parent bb9fbce commit 2e3d890

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ module.exports.transform = function(src, filename, options) {
206206
;({ src, filename, options } = src)
207207
}
208208

209-
if (filename.endsWith('.ts') || filename.endsWith('.tsx')) {
209+
if (filename.endsWith('.ts') || filename.endsWith('.tsx')) {
210210
if (compilerOptions.noEmitOnError) {
211211
const program = ts.createProgram([filename], compilerOptions)
212212

213213
const preErrors = ts
214214
.getPreEmitDiagnostics(program)
215215
.filter(({ category }) => category === ts.DiagnosticCategory.Error)
216216

217-
reportErrors(preErrors)
217+
reportErrors(preErrors, filename, options)
218218
}
219219

220220
const tsCompileResult = ts.transpileModule(src, {
@@ -227,7 +227,7 @@ module.exports.transform = function(src, filename, options) {
227227
({ category }) => category === ts.DiagnosticCategory.Error
228228
)
229229

230-
reportErrors(errors)
230+
reportErrors(errors, filename, options)
231231

232232
const babelCompileResult = upstreamTransformer.transform({
233233
src: tsCompileResult.outputText,
@@ -265,7 +265,7 @@ module.exports.transform = function(src, filename, options) {
265265
}
266266
}
267267

268-
function reportErrors(errors) {
268+
function reportErrors(errors, filename, options) {
269269
if (errors.length) {
270270
// report first error
271271
const error = errors[0]
@@ -288,4 +288,4 @@ function reportErrors(errors) {
288288
throw new Error(message)
289289
}
290290
}
291-
}
291+
}

0 commit comments

Comments
 (0)