Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
type WorkingArray = {
outerProperty: Array<
{ innerPropertyOne: string } & { innerPropertyTwo: string }
>;
};
type BrokenArray = {
outerProperty: Array<
({ innerPropertyOne: string } & { innerPropertyTwo: string })
>;
};
ESLint Config
module.exports = {
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/strict"],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
ecmaVersion: "latest",
},
};
tsconfig
Expected Result
interface WorkingArray {
outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[];
}
interface BrokenArray {
outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[];
}
Actual Result
interface WorkingArray {
outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[];
}
interface BrokenArray {
outerProperty: { innerPropertyOne: string } & { innerPropertyTwo: string }[];
}
6c6
< outerProperty: { innerPropertyOne: string } & { innerPropertyTwo: string }[];
---
> outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[];
The meaning of the BrokenArray
type should not be changed.
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.42.1 |
@typescript-eslint/parser |
5.42.1 |
TypeScript |
4.8.4 |
ESLint |
8.27.0 |
node |
18.7.0 |