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

Fix typescript-eslint plugin 2.22.0 #2398

Closed

Conversation

KingDarBoja
Copy link
Member

Fixes #2396

Changes proposed:

  • Add
  • Delete
  • Fix
  • Prepare

@KingDarBoja KingDarBoja added the dependencies Pull requests that update a dependency file label Mar 3, 2020
@KingDarBoja KingDarBoja requested a review from JimiC March 3, 2020 03:18
@JimiC
Copy link
Member

JimiC commented Mar 3, 2020

We do mass updates before release. Usually.

@JimiC JimiC closed this Mar 3, 2020
@JimiC JimiC deleted the greenkeeper/@typescript-eslint/eslint-plugin-2.22.0 branch March 3, 2020 06:14
@robertohuertasm
Copy link
Member

Why closing this? I don't see the problem.

@JimiC
Copy link
Member

JimiC commented Mar 3, 2020

@robertohuertasm do u want to have to write entries in change log for every dependency update? Be my guest. From my pov it's better to do mass dependency updates.

@robertohuertasm
Copy link
Member

Generally speaking, I agree. But for this one, which included manual @KingDarBoja changes I thought it would be ok. I don't mind writing one extra log entry if that means saving anyone from repeating again the same task.. 😊

@JimiC
Copy link
Member

JimiC commented Mar 3, 2020

Even though it's best to keep dependencies updates tight. @KingDarBoja can include these changes on the mass update.

@JimiC
Copy link
Member

JimiC commented Mar 3, 2020

Additional, I had a look at the release notes. The changes Manuel did to the rule are trivial as those are the default values.

https://github.com/typescript-eslint/typescript-eslint/blob/5a097d316fb084dc4b13e87d68fe9bf43d8a9548/packages/eslint-plugin/src/rules/type-annotation-spacing.ts#L60

@JimiC
Copy link
Member

JimiC commented Mar 3, 2020

On the same note I plan on doing some cleanup on the rules. I already done so on my projects as a testing ground.

@robertohuertasm
Copy link
Member

Fair enough! 👍🏻👌🏻

@KingDarBoja
Copy link
Member Author

KingDarBoja commented Mar 3, 2020

@JimiC Those changes seem to be the default values until you try to fix the spacing before the arrow (or after the colon?) and save the file (compositionRootService - line 24), the lint-stage hook will automatically remove the space and once again, trigger the ESLint warning.

Also, the overrides of variable seems to do the work, as the colon setting doesn't work as stated on the docs.

The issue lies on this line:

type Class = new (...args: any[]) => any;

Without the extra setting, it will be autoformatted like:

type Class = new (...args: any[])=> any;

@JimiC
Copy link
Member

JimiC commented Mar 4, 2020

I'll have a look at it.

@robertohuertasm
Copy link
Member

Shall we reopen this to not keep track of it?

@JimiC
Copy link
Member

JimiC commented Mar 4, 2020

Give me some time pls.

@JimiC
Copy link
Member

JimiC commented Mar 4, 2020

After testing it the rule has issues.

First of all the correct syntax when using options is:

"@typescript-eslint/type-annotation-spacing": [
      "error",
      {
        "overrides": {
          "arrow": {
            "before": true,
            "after": true
          }
        }
      }
    ],

but even using it, it produces the same error. My syggestion is to wait untill a fix is provided (I may get involved in this).

@JimiC
Copy link
Member

JimiC commented Mar 4, 2020

The issue is caused by the rule not recognizing the new keyword.
type Class = new (...args: any[]) => any; fails but type Class = (...args: any[]) => any; passes but then the type annotation fails.

@JimiC
Copy link
Member

JimiC commented Mar 4, 2020

Resolved: typescript-eslint/typescript-eslint#1664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨
3 participants