Skip to content

Fails to parse <const> assertion  #33

@arjunu

Description

@arjunu

What version of this package are you using?
1.0.0-beta.0

What operating system, Node.js, and npm version?
macOS BigSur 11.6, v14.17.5, 7.24.0

What happened?
Fails to parse <const> assertion introduced in TypeScript 3.4.

Note: it's in a .ts file which is allowed.

const test = {
  type: <const>"SOME_STRING",
}

gives

FileParsingFailedError: [structlint] Failed to parse ...
Unterminated JSX contents (6:15)
    at Object.parse (/Users/arjun/Documents/GitHub/structlint/src/parsers/parser-babel.ts:103:11)
    at parse (/Users/arjun/Documents/GitHub/structlint/src/parsers/index.ts:28:17)
    at Array.forEach (<anonymous>)
    at lint (/Users/arjun/Documents/GitHub/structlint/src/tasks/importsTask.ts:67:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 1)
    at runTask (/Users/arjun/Documents/GitHub/structlint/src/tasks/importsTask.ts:72:22)
    at async Promise.all (index 0)

What did you expect to happen?
Command runs without issues

Are you willing to submit a pull request to fix this bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions