-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add eqeqeq eslint rule #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
fyi, 400+ breaks of eqeqeq on DXP |
| cleanDirectory(tempPath); | ||
|
|
||
| if (initCwd != null) { | ||
| if (initCwd !== null && initCwd !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we express this as if (initCwd) . I find if (initCwd !== null && initCwd !== undefined) a bit too complex to use it in every place of the code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal with using initCwd !== null && initCwd !== undefined is that it is safer for a wide refactor since initCwd != null is equal to initCwd !== null && initCwd !== undefined
If I was writing new code, I would likely use if (initCwd), but I can't totally be sure that this bit of code would work with that unless I tested it thoroughly(which I didn't since I touched lots of code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is only for this PR, it's OK and we may refactor them when we come back to the code. But if it is going to be our usual pattern, I find it a bit too much for my refined taste
Just saw this from below. Yep, this is just for this PR and not something I intend for us to do. Only made that change for some safety in refactoring.
| } | ||
|
|
||
| if (!subscriptionKey || subscriptionKey == '') { | ||
| if (!subscriptionKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| return getNamespace(moduleName) != null; | ||
| const nameSpace = getNamespace(moduleName); | ||
|
|
||
| return nameSpace !== null && nameSpace !== undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be !!getNamespace(moduleName) as well...
|
AEIOK (apparently, everything is OK). I'm a bit worried about those |
|
Ah, pretty cool rule, didn't know it was present in the default ESLint config, but it makes sense that it is. It's gonna be awesome to enforce these. Oh, also LNHTM |
|
Looks like we are on the same page and gonna merge. |
fixes #14
@izaera, could you check my changes to make sure I didn't break anything? I updated all cases of
someVal == nullandsomeVal != nullto also include a check for undefined since we are enforcing===