-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Some typescript language features seems to throw parsing errors while using the default ESLint-Config from chayns-toolkit and the chayns-toolkit lint
command. It only happens, when you import a typescript file within a javascript-file (including jsx).
The features that throw a parsing exceptions are:
- Type Assertions using the as operator
- The keyof operator
Steps to reproduce:
- create a new project using create-chayns-app
- install typescript (4.0.5 is the last version that is currently officially supported by @typescript-eslint/typescript-estree)
- start the created app to generate a tsconfig.json file
- create a new file src/test.ts with the content
export cosnt test = {} as { test?: string }
- import the test-constant inside the src/index.jsx file and use it (e.g. use console.log(test))
Example:
The linting of the line type DialogOptionsKey = keyof DialogOptions
is aborted with Parse errors in imported module ../../utils/getDialogOption.ts: Line 6: Unexpected token, expected ";"
Versions:
- typescript: 4.0.5
- chayns-toolkit: 1.5.1