Closed
Description
Stripping null
and undefined
from targets
- We already avoid elaborating when relating primitives to unions.
- Action item: don't work on primitives, just work on objects.
User Test Suite
- Signed off
- @Andy-MS, can you take a look at that weird change?
Exposing diagnostic codes to related error spans
- Should codes be
Error
?Suggestion
?Info
? - Discuss in issue.
Related Error Spans
- Reprioritized
- Duplicate declaration/redeclared block scoped variable errors
- Having the link to the declarations is useful
- But usually it's not that you have 100 of the same error, it's usually that you have 100 errors in two files respectively (because they're identical).
- Maybe limit 5 duplicate declaration error within a file, taper off with "N other duplicates have been detected"
- If all the top-level declarations are duplicate, potentially just consider the file a duplicate?
- Maybe say "File A duplicates identifiers x, y, z, a, ..., q from file B".
- This one seems good.
- We'll figure out how to do it
- Action item: file an issue for better consolidation.
Most searched errors (?)
- We literally typed in
error TS
into Google and let it auto-complete.- Probably good enough.
- TS2339, TS2307, TS2304, TS2322, TS2531, TS1005, TS2305, TS2345, TS2306
- "error ts2304 cannot find name"
- Google completes with
require
,map
,buffer
,describe
,$
,asyncIterator
,process
,symbol
,module
,promise
- Should we provide a better error on these?
- Yes!
- You're using
$
=> Suggest jQuery - You're using
describe
=> Did you mean to have types for mocha, jest, etc.? process
,require
,module
=> Node typesSymbol
,Promise
,Map
,Set
,asyncIterator
=> Differentlib
ortarget
.- Action item: Better elaborations
- Google completes with
- "error ts2531 object is possibly 'null/undefined'"
- What can we do?
- Possibly tell people to use the
!
? - Might be the wrong way to lead users down the right path.
- Possibly tell people to use the
- What can we do?
- "Typescript error TS1005: ';'"
- Recurring issue with Visual Studio installations not overriding existing
tsc
.
- Recurring issue with Visual Studio installations not overriding existing
- "Argument of type X is not assignable to parameter of type Y"
- https://stackoverflow.com/questions/34738799/argument-of-type-x-is-not-assignable-to-parameter-of-type-x
- This is the first result
- And the top answer is https://stackoverflow.com/a/34738923!
- Really, you want to know that you meant to call the value.
- Need to know you're checking in an expression context.
- Action item: Create better error message for uncalled values
- "File is not a module"
- How do we explain modules to people in the terminal?
- Could provide an explanation in every error
- Becomes noisy
- Rust has a suggestion to run with
--showElaborations
.
- Rust has a suggestion to run with
- Becomes noisy
- Provide a link?
- But you don't want to provide a link for every error.
- "Consider searching Google for-"
- lol