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

error when trying process Typescript files #72

Closed
felixcatto opened this issue Sep 20, 2018 · 4 comments
Closed

error when trying process Typescript files #72

felixcatto opened this issue Sep 20, 2018 · 4 comments

Comments

@felixcatto
Copy link

TS version: 3.0.3
import-sort-cli: 5.2.0

When i trying to process .ts or .tsx i got following error :'(
TypeError: parser.parseImports is not a function

But with .js files all working well.

package.json

  "importSort": {
    ".js, .jsx, .es6, .es": {
      "parser": "babylon",
      "style": "eslint"
    },
    ".ts, .tsx": {
      "parser": "typescript",
      "style": "eslint"
    }
  },
@felixcatto felixcatto changed the title error when trying porcess Typescript files error when trying process Typescript files Sep 20, 2018
@yuriykuzin
Copy link

@felixcatto Did you manage to make it work? I'm facing the same issue

@yuriykuzin
Copy link

yuriykuzin commented Oct 30, 2018

Aha! It works after installing additionally the proper parser:

npm i -D import-sort-parser-typescript

@renke What do you think about mentioning this in docs?

@felixcatto
Copy link
Author

@felixcatto Did you manage to make it work? I'm facing the same issue

Nope, i just read that in other languages imports stays unsorted and it is ok :)

@PaulRBerg
Copy link

@renke What do you think about mentioning this in docs?

Seconded. It would be helpful to mention this in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants