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

[type-annotation-spacing] 2.22.0 regression for constructor arrow function types #1663

Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@kryops
Copy link

kryops commented Mar 3, 2020

Repro

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "plugins": [
    "@typescript-eslint"
  ],
  "rules": {
    "@typescript-eslint/type-annotation-spacing": ["error"]
  }
}
type ConstructorFn = new (...args: any[]) => any;

Expected Result
No error

Actual Result

Unexpected space before the '=>'.eslint(@typescript-eslint/type-annotation-spacing)

Additional Info

This only seems to affect 2.22.0. When downgrading to 2.21.0, the error is gone.

Normal arrow functions without a new keyword are not affected:

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

Versions

package version
@typescript-eslint/eslint-plugin 2.22.0
@typescript-eslint/parser 2.22.0
TypeScript 3.7.5
ESLint 6.8.0
node 10.15.3
npm yarn 1.17.3
@kryops kryops added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Mar 3, 2020
@bradzacher bradzacher added bug Something isn't working has pr there is a PR raised to close this and removed triage Waiting for maintainers to take a look labels Mar 3, 2020
unional added a commit to mocktomata/mocktomata that referenced this issue Mar 8, 2020
@typescript-eslint/type-annotation-spacing
due to
typescript-eslint/typescript-eslint#1663
royra pushed a commit to salto-io/salto that referenced this issue Mar 8, 2020
* upgraded TypeScript to 3.8.3 and eslint to to 2.22.0
* downgraded @typescript-eslint to 2.21.0 due to typescript-eslint/typescript-eslint#1663
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.