palantir / tslint

:vertical_traffic_light: An extensible linter for the TypeScript language
http://palantir.github.io/tslint/
Apache License 2.0
5.91k stars 890 forks source link

UnhandledPromiseRejectionWarning: #3637

Closed sanex3339 closed 6 years ago

sanex3339 commented 6 years ago

Bug Report

TypeScript code being linted

this project https://github.com/javascript-obfuscator/javascript-obfuscator/tree/master/src

with tslint.json configuration: https://github.com/javascript-obfuscator/javascript-obfuscator/blob/master/tslint.json

Actual behavior

error

(node:69959) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Cannot read property 'map' of undefined
(node:69959) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

image

Expected behavior

no errors

Description

After updating from 5.8.0 to new 5.9.0 version i got this error. ts-lint is running via tslint-webpack-plugin@1.0.0

adidahiya commented 6 years ago

Can you run it with the CLI to get a better stack trace?

sanex3339 commented 6 years ago

No error via CLI. Maybe this error related with integration between ts-lint@5.9.0 and tslint-webpack-plugin@1.0.0?

sanex3339 commented 6 years ago

In 5.9.1 still this error.

adidahiya commented 6 years ago

I took a brief look at tslint-webpack-plugin and couldn't see any problems immediately. Note that the package looks somewhat outdated and seems to use what is considered private API (it imports from "tslint/lib/runner"). I could help you further if you had a more verbose stack trace.

peterreisz commented 6 years ago

@sanex3339 I've had the same problem, the workaround is:

new TSLintPlugin({
  files: ['./src/**/*.ts'],
  exclude: [] // add this empty array option
})
johnwiseheart commented 6 years ago

Going to close this issue as it appears to be resolved by @peterreisz 's comment above.