Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Changes to configurations for 6.0.0#6014
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
BetaWas this translation helpful?Give feedback.
All reactions
🎉 2
Replies: 11 comments 16 replies
-
I think this is a good style to enforce and most of the time having a duplicate is a bug.
Some codebases do use redundant constituents as a way of documenting possible values.
This rule was explicitly added to the recommended set in v3.0.0 -#1423 👍 LGTM - no comment➕🛑
|
BetaWas this translation helpful?Give feedback.
All reactions
-
👍 from me on most of that! Just one thread:
Is there a strong argument to have thisand |
BetaWas this translation helpful?Give feedback.
All reactions
-
declareconstnum:number;declareconststr:string;declareconstbool:boolean;declareconstobj:{};declareconstobjToStr:{toString():string};declareconstany:any;declareconstunk:unknown;num+num;// NO errornum+str;// RPO error// num + bool; // TS error// num + obj; // TS error// num + objToStr; // TS errornum+any;// RPO error// num + unk; // TS errorstr+str;// NO errorstr+bool;// RPO errorstr+obj;// NBTS + RPO error ////////// ONLY CASE NBTS ERRORS ONstr+objToStr;// RPO errorstr+any;// RPO error// str + unk; // TS error// bool + bool; // TS error// bool + obj; // TS error// bool + objToStr; // TS errorbool+any;// RPO error// bool + unk; // TS error// obj + obj; // TS error// obj + objToStr; // TS errorobj+any;// RPO error// obj + unk; // TS error// objToStr + objToStr; // TS errorobjToStr+any;// RPO error// objToStr + unk; // TS errorany+any;// RPO errorany+unk;// RPO error// unk + unk; // TS error |
BetaWas this translation helpful?Give feedback.
All reactions
-
Got it, thanks - that makes a lot of sense to me. Keeping in 👍 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Filed#6110 to add some friendly options to it. I'll propose we enable those options for both rules by default. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hello, I was directed here fromeslint/eslint#16557 (reply in thread) about feedback on the defaults. Looking at the configuration we have in our app, there are two rules that I would change from the table above:
Other than these, I'm on board with the changes to remove rules that have been deemed too opinionated or obsoleted by a code formatter. Thank-you for all the work you are doing on TS-ESLint integration. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
🤔 do you have any examples of this? Out of those two cases:
Yeah this is unfortunate. I would really love to be able to enablesomething in the recommended ruleset that discourages type assertions - since they'realmost always indicative of a flaw in the type system. But sometimes that flaw is in TypeScript itself, and/or something not really able to be overcome. Hence lumping it into |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Are there any specific criteria for |
BetaWas this translation helpful?Give feedback.
All reactions
-
Good question. We should document this somewhere! The description onhttps://typescript-eslint.io/linting/configs#recommended-configurations is a little vague:
The heuristics I've been using have been roughly:
How does that feel? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I am not an expert, but I think it is generally good. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I've been thinking about the indicators of a
|
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
This comment was marked as off-topic.
This comment was marked as off-topic.
-
hey@reintroducing - could you please file an issue for each of your questions? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Absolutely, apologies for the noise. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@bradzacher sorry, i mean this to be a reply to your comment above but did it through my phone and realized just now it went as a new comment (thus creating even more noise). Feel free to mark this one off topic as well (or just completely delete it). |
BetaWas this translation helpful?Give feedback.
All reactions
-
Where is |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ah good callout, thank you! It was merged after the last time I went over this list. Just updated now to indicate it's meant to move fromstrict torecommended-type-checked. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
I'm testing the delta but it doesn't seem to be applying the new rules in some cases. For example, when I comment out my existing
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Is it possible that the other plugins are forcing it back to v5 because they need it as a dependency? |
BetaWas this translation helpful?Give feedback.
All reactions
-
That is a possibility, yes. You can try debugging techniques such as |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
Would this be a good opportunity to change the default of |
BetaWas this translation helpful?Give feedback.
All reactions
-
Oof, sorry for the delay@tylerlaprade - I'd missed this comment. I believe we're keeping it |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Thanks for the reply,@JoshuaKGoldberg! I don't see those two options as equivalent nor as opinionated, though. As per the current documentation, while The default for all other nullable primitives is Apologies if I missed it, but what makes |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
D'oh! You're right, I mistook the two. Per#6760 we're going to want to make a few changes (or at least: I'll propose them). Linking here so it's not missed. Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
Noting a change from#7110: we're going to keep |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
#7110 was merged into the |
BetaWas this translation helpful?Give feedback.
All reactions
🎉 1❤️ 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Just discovered that the default where completely changed for |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #5900 on November 17, 2022 15:54.