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

Add a code fixer for --isolatedDeclarations errors #58260

Merged
merged 15 commits into from Apr 30, 2024

Commits on Apr 19, 2024

  1. Add a fixer to fix type errors for --isolatedDeclarations

    This code fixer fixes the following patterns.
    
    1. Adding missing types on places that type can be explicitly annotated
    2. Adding satisfies with type assertion on a value.
    3. Create a namespace for expando functions and declare the property on
       the namespace.
    4. Factor out expressions in heritage clauses (class B extends <expression>)
       and give them separate names.
    
    Signed-off-by: Hana Joo <hanajoo@google.com>
    h-joo committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    4e506f9 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    0191a46 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c9698a3 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    33e82b3 View commit details
    Browse the repository at this point in the history
  2. Suggest a type annotation for widened unions of type literals

    such as "A"|"B" --> string in case the d.ts emitter widens it.
    
    Also expose 'getWidenedLiteralType' as an internal API for the
    fixer to be able to imitate what the type checker is doing.
    h-joo committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    5704f4e View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Call widening functions on the correct type when adding satisfies to …

    …expressions
    
    Widening of types only work on types from variable declaration, so when
    getWidenedLiteralType is being called on expressions the compiler wouldn't
    widen it. So call getWidenedLiteralType on the type of variables instead on
    those cases.
    h-joo committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    cb45ffe View commit details
    Browse the repository at this point in the history
  2. npm run format

    h-joo committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    00e507c View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    023d32f View commit details
    Browse the repository at this point in the history
  2. Factor out a functionality to generate a variable name

    and reuse it. Remove suggestVariableName as this adds
    very little value compared to the code size it had.
    h-joo committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    38f6a3d View commit details
    Browse the repository at this point in the history
  3. Update src/compiler/diagnosticMessages.json

    Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
    h-joo and andrewbranch committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    2086cb9 View commit details
    Browse the repository at this point in the history
  4. Update tests

    h-joo committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    03cc990 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c4f0b81 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    69d0044 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    48ed32b View commit details
    Browse the repository at this point in the history
  8. npm run format

    h-joo committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    1632489 View commit details
    Browse the repository at this point in the history