feat: Disable typescript-eslint's array-type and consistent-type-definitions #1520
Labels
🔰 good first issue
Good for newcomers
🌟 enhancement
New feature or request
👨👦👦free for all
Anyone is free to take on this issue and file a PR
Is your feature request related to a problem? Please describe.
In #1476, create-t3-app started using
"plugin:@typescript-eslint/stylistic-type-checked"
, which includes"plugin:@typescript-eslint/stylistic"
. Those opinionated stylistic config presets include a couple of rules that seem to be irritating users on Twitter:@typescript-eslint/array-type
: Requires consistently using eitherT[]
orArray<T>
for arrays.@typescript-eslint/consistent-type-definitions
: Enforce type definitions to consistently use eitherinterface
ortype
.Some folks like them enabled as-is. Others prefer the opposite. Either way, it looks like enabling them by default is turning people off of create-t3-app and/or linting and/or TypeScript in general. Although we know ESLint rules are straightforward you can turn off or reconfigure, it's still a bad first impression for others.
For reference, here are all the rules in the stylistic configs: https://typescript-eslint.io/rules/?supported-rules=stylistic
Describe the solution you'd like to see
These two rules seem to be the most consistently chafe-y from
stylistic(-type-checked)
. Perhaps we should disable them in the.eslintrc.cjs
template?Describe alternate solutions
Not extending from
stylistic-type-checked
at all? This would mean less friction for users... but less benefit too. Most of the rules are pretty nice:no-inferrable-types
,prefer-nullish-coalescing
,prefer-optional-chain
, ...Additional information
I think this was a misplay on my end. We never resolved https://github.com/t3-oss/create-t3-app/pull/1476/files#r1234060608 over whether to include
consistent-type-definitions
, and I could have predicted that folks wouldn't likearray-type
. Sorry for causing user pain and tooling churn. 🙂This is also making me wonder if we should turn those rules off in
stylistic
in a future major version of typescript-eslint... TBD.The text was updated successfully, but these errors were encountered: