[type-annotation-spacing] 2.22.0 regression for constructor arrow function types #1663
Closed
Description
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 |