-
Notifications
You must be signed in to change notification settings - Fork 148
chore: migrate codebase ESLint config #385
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
I'm getting a new error without updating any dependency now 🤔
And we are getting this error now too on CI. I don't know what's causing that, the CI was passing yesterday (I've checked the lint command locally without changing anything from yesterday and it fails too). @MichaelDeBoey any idea? Edit: I've just disabled |
This rule is causing an ESLint error which prevents the rest of the project to be linted.
if (ASTUtils.isVariableDeclarator(node)) { | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
return context.getDeclaredVariables(node)[0]?.references?.slice(1) ?? []; | ||
} | ||
|
||
return []; |
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.
Maybe do an early return instead?
if (ASTUtils.isVariableDeclarator(node)) { | |
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | |
return context.getDeclaredVariables(node)[0]?.references?.slice(1) ?? []; | |
} | |
return []; | |
if (!ASTUtils.isVariableDeclarator(node)) { | |
return []; | |
} | |
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | |
return context.getDeclaredVariables(node)[0]?.references?.slice(1) ?? []; |
I normally don't like negative conditions, but I'm more in favor of having the "main" thing at the end
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.
That would fix it here but could potentially introduce errors in new code, so I've just switched off this rule until there is an option to ignore arrays within conditions.
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.
I didn't suggest it because of the disabling of ESLint, but because
I'm more in favor of having the "main" thing at the end
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.
Ah sorry, didn't realize that. I don't see any benefit in this case, I guess it's a matter of taste.
🎉 This PR is included in version 4.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #384
This PR: