blakeembrey / tslint-config-standard

A TSLint config for JavaScript Standard Style
Other
358 stars 43 forks source link

Promises must be handled appropriately #55

Closed CaiPeng1989 closed 5 years ago

CaiPeng1989 commented 5 years ago

If I use finally, tslint will throw a warning at compile time: "Promises must be handled proper".

19:5 Promises must be handled appropriately
    17 | export default class Home extends Vue {
    18 |   created () {
  > 19 |     this.$axios.get('/')
       |     ^
    20 |       .then((res: any) => console.log(res))
    21 |       .catch((error: any) => console.warn(error))
    22 |       .finally(() => console.log('finally'))
No type errors found
Version: typescript 3.1.6, tslint 5.11.0
Time: 815ms

Everything works fine without finally. Please fix it.

blakeembrey commented 5 years ago

@CaiPeng1989 I think this belongs in https://github.com/palantir/tslint/issues, this module doesn't create any of the rules but provides a default slate similar to StandardJS.

CaiPeng1989 commented 5 years ago

But, if I use tslint:recommended, no problem.

blakeembrey commented 5 years ago

I don’t think that configuration has this rule enabled so that makes sense.