Skip to content
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

AA-13801 Create no-declare rule to prevent using declare keyword #1

Merged
merged 4 commits into from
Aug 9, 2022

Conversation

norbertprocak
Copy link
Collaborator

package.json Outdated
@@ -0,0 +1,40 @@
{
"name": "@livechat/eslint-plugin",
"version": "0.1.7",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why such a strange version? Shouldn't we start with 1.0.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's my working version, I will replace it with 1.0.0 when task is ready to merge

create(context, [options]) {
const { onlyIdentifiers, excludeIdentifiers } = options;
const onlyIdentifiersEnabled =
onlyIdentifiers && onlyIdentifiers?.length > 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onlyIdentifiers && onlyIdentifiers?.length > 0;
!!onlyIdentifiers?.length;

Copy link
Collaborator Author

@norbertprocak norbertprocak Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 😆

const onlyIdentifiersEnabled =
onlyIdentifiers && onlyIdentifiers?.length > 0;
const excludeIdentifiersEnabled =
excludeIdentifiers && excludeIdentifiers.length > 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!excludeIdentifiers.length

Copy link
Collaborator Author

@norbertprocak norbertprocak Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 😛


return {
VariableDeclaration(node) {
if (node.declare) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (node.declare) {
if (!node.declare) {
return
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@norbertprocak norbertprocak merged commit ea6dd3c into master Aug 9, 2022
@norbertprocak norbertprocak deleted the feature/AA-13801 branch August 9, 2022 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants