curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
525 stars 7 forks source link

Tslint to eslint #149

Closed juhangsin closed 4 years ago

juhangsin commented 4 years ago

Ran eslint with fixes. There's one case i wasn't sure and didn't add to this PR which is

before change: let status: number = 303; after change: let status = 303;

type should be there, but not sure how to fix that yet.

juhangsin commented 4 years ago

Currently this won't pass Travis CI build

evert commented 4 years ago

I think not having the type is OK: let status = 303;

It's a bit of an aggressive rule though, so either changing that line or removing the rule from our default ruleset works for me. If we do remove it, we should also bring that change back to new-package.

juhangsin commented 4 years ago

t having the type is OK: let status = 303;

i'd definitely would like to have that rule applied since that defeats the purpose for using TS. I'll look into this and apply to everything we've done so far.

juhangsin commented 4 years ago

Very interesting, we even have the rule for ignoring this case

"@typescript-eslint/no-inferrable-types": ["error",
        {
          "ignoreParameters": true
        }
      ],

but the rule is being ignored for numbers.

evert commented 4 years ago

I think that rule says we only ignore parameters/arguments.

since that defeats the purpose for using TS

When you define let status = 303 typescript internally does track that it can only ever be a number, that's why the rule to disable this is called no-inferrable-types. You could argue that the type information is a bit redundant... but disabling the rule still works for me. Either way