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

ESLint: Parsing errors while using some typescript features #9

Open
michael-braun opened this issue Nov 23, 2020 · 0 comments
Open
Labels
bug Something isn't working topic: eslint

Comments

@michael-braun
Copy link
Contributor

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:

  1. create a new project using create-chayns-app
  2. install typescript (4.0.5 is the last version that is currently officially supported by @typescript-eslint/typescript-estree)
  3. start the created app to generate a tsconfig.json file
  4. create a new file src/test.ts with the content export cosnt test = {} as { test?: string }
  5. 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
@michael-braun michael-braun added bug Something isn't working topic: eslint labels Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic: eslint
Projects
None yet
Development

No branches or pull requests

1 participant