consistentTypeDefintions
, @typescript-eslint/consistent-type-definitions
#4360
Replies: 3 comments
-
I would consider this proposal a very low priority. And not recommended. Rome had a rule called I would argue, instead, that it's better to create |
Beta Was this translation helpful? Give feedback.
-
The TypeScript team advocates the use of I personally prefer I pretty like how Flow distinguishes
Thus, in my view these two syntaxes communicate distinct intentions and programming paradigms. Both should be allowed. I think we should not implement this rule. |
Beta Was this translation helpful? Give feedback.
-
I see your feedback and actually agree with you. My thinking is from an older time, it’s not relevant anymore. Closing |
Beta Was this translation helpful? Give feedback.
-
Often developers will write types and interfaces in interchangeable ways:
It's more consistent to require the above type
T1
to be defined as an interface as it 'looks' like one.https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
Beta Was this translation helpful? Give feedback.
All reactions