Skip to content

lint(eslint): Enable array-type rule & auto-fix violations#83804

Merged
ryan953 merged 2 commits into
masterfrom
ryan953/eslint-array-type
Jan 22, 2025
Merged

lint(eslint): Enable array-type rule & auto-fix violations#83804
ryan953 merged 2 commits into
masterfrom
ryan953/eslint-array-type

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented Jan 22, 2025

No description provided.

@ryan953 ryan953 requested review from a team as code owners January 22, 2025 05:12
@ryan953 ryan953 requested a review from a team January 22, 2025 05:12
@ryan953 ryan953 requested review from a team as code owners January 22, 2025 05:12
@ryan953 ryan953 requested review from a team January 22, 2025 05:12
@ryan953 ryan953 requested review from a team as code owners January 22, 2025 05:12
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 22, 2025
@ryan953 ryan953 merged commit 2254052 into master Jan 22, 2025
@ryan953 ryan953 deleted the ryan953/eslint-array-type branch January 22, 2025 17:49
ryan953 added a commit that referenced this pull request Jan 23, 2025
…ion (#83927)

This was suggested in slack and I really like the
[`array-simple`](https://typescript-eslint.io/rules/array-type/#array-simple)
variation over the default
[`array`](https://typescript-eslint.io/rules/array-type/#array) that we
enabled [yesterday](#83804).

TL/DR the `array-simple` variation will prefer `MyType[]` when `MyType`
is a simple, or named type. If there's anything more complex in that
spot, like a union or unnamed object type then we'll see `Array<...>`
instead. This means in practice we wont' see round braces near our
complex array definitions; less syntax for my eyes to parse.
andrewshie-sentry pushed a commit that referenced this pull request Jan 29, 2025
…ion (#83927)

This was suggested in slack and I really like the
[`array-simple`](https://typescript-eslint.io/rules/array-type/#array-simple)
variation over the default
[`array`](https://typescript-eslint.io/rules/array-type/#array) that we
enabled [yesterday](#83804).

TL/DR the `array-simple` variation will prefer `MyType[]` when `MyType`
is a simple, or named type. If there's anything more complex in that
spot, like a union or unnamed object type then we'll see `Array<...>`
instead. This means in practice we wont' see round braces near our
complex array definitions; less syntax for my eyes to parse.
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants