镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Error UX Improvement Sync, 6/28/2018 #25306

Description

Stripping null and undefined from targets

#25287

  • We already avoid elaborating when relating primitives to unions.
  • Action item: don't work on primitives, just work on objects.

User Test Suite

#25294

Exposing diagnostic codes to related error spans

#25304

  • Should codes be Error? Suggestion? Info?
  • Discuss in issue.

Related Error Spans

#25257

  • 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 types
    • Symbol, Promise, Map, Set, asyncIterator => Different lib or target.
    • Action item: Better elaborations
  • "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.
  • "Typescript error TS1005: ';'"
    • Recurring issue with Visual Studio installations not overriding existing tsc.
  • "Argument of type X is not assignable to parameter of type Y"
  • "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.
    • Provide a link?
      • But you don't want to provide a link for every error.
    • "Consider searching Google for-"
      • lol

Activity

  1. changed the title [-]Error Message Improvements Sync, 6/28/2018[/-] [+]Error UX Improvements Sync, 6/28/2018[/+] on Jun 28, 2018
  2. changed the title [-]Error UX Improvements Sync, 6/28/2018[/-] [+]Error UX Improvement Sync, 6/28/2018[/+] on Jun 28, 2018
  3. RyanCavanaugh commented on Jun 28, 2018

    @RyanCavanaugh
    Member

    We could run the numbers on @types packages by download count and make a reverse map from the globals they expose => suggestions for things to install. A quickfix would turn it into an amazing demo...

  4. mhegazy commented on Jun 28, 2018

    @mhegazy
    Contributor

    We can do that as part of #25308. we just need a json file of sorts that map global variable to a package file, and the compiler can use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions