Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 1/6/2017 #13331

Closed
mhegazy opened this issue Jan 6, 2017 · 0 comments
Closed

Design Meeting Notes, 1/6/2017 #13331

mhegazy opened this issue Jan 6, 2017 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jan 6, 2017

Instanceof requires callable or constructable right-hand side

interfaces, spread and own/enumerable properties

  • works as designed
  • users do not find this intuitive, and when they see the behavior perceive it as a bug
  • conclusion:
    • only filter methods if we know they come from a class. otherwise keep them (i.e. object literals and interfaces).
    • may need to have annotations in the future to track enumrability on interface property declarations

Configurable errors in JS

  • allow types annotations in JS files

    • some sort of marker
    • the marker should say if you want errors
    • the marker should also say if type annotations are allowed
    • motivation, use tsc as a checker for your .js files, use other transpiler like babel to transform the code
  • some rule proposal:

    • in a .js file
      • Always error on interfaces, types, namespaces, enums, or any TS-specific constructs
      • Marker to opt-in error reporting, types and type annotations
        • namespaces and enums should not be allowed here
      • Always use JSDoc
      • type annotations always win over JSDoc
      • Always show syntax errors
  • what errors should here:

    • all?
    • ppl look for a linter mode
    • we need to configure these errors to make sure we error on permissiveness, e.g.
    • we do not want to make types configurable:
      • we need to define a taxonomy for errors
      • report errors the same way
      • commit to maintaining error codes consistent for ever
      • if we ever change anythign about error codes, or when they are raised, we break ppl's builds
      • C++ and C# struggled with allowing disabling specific errors
  • is it a design goal to get to a 0 errors in a .js file without using type annotations?

    • obviously syntax and early errors should be allowed
    • we need to enable it first, then see what happened..
    • we can use comments on lines to disable errors on a specific lines/region
    • but most linters have that ability to disable specific errors
  • we need to enable it for all files, or specific file by file to allow ppl to move from one file to another

  • should strict-null-checks be on by default?

    • there is value here
    • users will have to write type annotations
    • what about users who want to write a pure JS?
      • .d.ts files are always allowed to provide additional type information
  • checkJS as a new flag to allow errors in all .js files

@mhegazy mhegazy added the Design Notes Notes from our design meetings label Jan 6, 2017
@mhegazy mhegazy closed this as completed Jan 6, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

1 participant