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

fix(typescript-estree): add ExportDefaultDeclaration to union DeclarationStatement #378

Merged
merged 1 commit into from Mar 27, 2019

Commits on Mar 27, 2019

  1. ADD ExportDefaultDeclaration to union DeclarationStatement

    I have this example:
    
    https://astexplorer.net/#/gist/2c50aae34bea149fc9863a2dd0e7a6f5/69d563ee31f1bc01d3cf71c005bb92dd24c3910e
    
    Notice how
    ```
    export default class Foo {}
    ```
    
    Is transformed to:
    
    ```
    {
          "type": "ExportDefaultDeclaration",
          "declaration": {
            "type": "ClassDeclaration",
            "id": {
              "type": "Identifier",
              "name": "Foo",
              "range": [
                580,
                583
              ],
              "loc": {
                "start": {
                  "line": 30,
                  "column": 21
                },
                "end": {
                  "line": 30,
                  "column": 24
                }
              }
            },
            "body": {
              "type": "ClassBody",
              "body": [],
              "range": [
                584,
                586
              ],
              "loc": {
                "start": {
                  "line": 30,
                  "column": 25
                },
                "end": {
                  "line": 30,
                  "column": 27
                }
              }
            },
            "superClass": null,
            "range": [
              574,
              586
            ],
            "loc": {
              "start": {
                "line": 30,
                "column": 15
              },
              "end": {
                "line": 30,
                "column": 27
              }
            }
          },
          "range": [
            559,
            586
          ],
          "loc": {
            "start": {
              "line": 30,
              "column": 0
            },
            "end": {
              "line": 30,
              "column": 27
            }
          }
        }
    ```
    
    according to Program.body which is a Statement[]
    
    and `Statement` containing `DeclarationStatement`
    
    I conclude that `DeclarationStatement` is missing `ExportDefaultDeclaration`
    ndelangen committed Mar 27, 2019
    Copy the full SHA
    2133d91 View commit details
    Browse the repository at this point in the history