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

TypeScript: Broken autofix for functions with async name #17

Closed
svr93 opened this issue Jul 7, 2019 · 3 comments
Closed

TypeScript: Broken autofix for functions with async name #17

svr93 opened this issue Jul 7, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@svr93
Copy link

svr93 commented Jul 7, 2019

I have noticed a strange behaviour that occurs with Angular testing library.
Before autofix:

import { TestBed, async } from '@angular/core/testing';

After autofix:

import { ,asyncTestBed } from '@angular/core/testing';

Package versions:
eslint-plugin-simple-import-sort -> 4.0.0
@typescript-eslint/eslint-plugin -> 1.10.2
@typescript-eslint/parser -> 1.10.2

async is not a reserved keyword - see https://www.ecma-international.org/ecma-262/10.0/index.html#sec-keywords

@lydell
Copy link
Owner

lydell commented Jul 7, 2019

Hi! Thanks for the issue!

I managed to reproduce your issue here: https://github.com/lydell/eslint-plugin-simple-import-issue

It seems like it only happens with in TypeScript.

I/we need to:

  • Figure out what’s happening.
  • See if it is an error in this plugin.
  • See if it is an error in @typescript-eslint/parser, and if so, report it.
  • See if there’s a workaround we can use in this plugin

Luckily, for now you can work around the problem by manually fixing the broken cases.

@lydell lydell added the bug Something isn't working label Jul 7, 2019
@lydell lydell changed the title Broken autofix for functions with async name TypeScript: Broken autofix for functions with async name Jul 7, 2019
@svr93
Copy link
Author

svr93 commented Jul 7, 2019

@lydell Thank you!
The problem with @typescript-eslint/typescript-estree package.

I was able to reproduce it - typescript-eslint/typescript-eslint#678

@lydell
Copy link
Owner

lydell commented Jul 8, 2019

I'm going to close this since typescript-eslint/typescript-eslint#681 has been merged.

This will we on npm when the next version (after v1.11.0) of the @typescript-eslint packages are released.

@lydell lydell closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants