Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
Milestone
Description
Repro
{"rules": {"typescript/no-use-before-define": ["error",{"typedefs":true}] }}
// Should error according to docs, but it wontletmyVar:StringOrNumber='hello'typeStringOrNumber=string|number
Expected Result
Should work according to docs
Actual Result
Doesn't work at all
Additional Info
Also dunno if this is considered within the implementation, but there is a common pattern in React to get Props/State types from implementation by leveragingtypeof
. So iftypedefs
is set tofalse
this should not raise any error:
typeState=typeofinitialStateconstinitialState={count:0,who:''}
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 1.3.0 |
@typescript-eslint/parser | X.Y.Z |
TypeScript | 3.3.3 |
ESLint | 5.12 |
node | 8.15 |
npm | X.Y.Z |