Skip to content

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

@kryops

Description

@kryops

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy