Skip to content

feat: rule warns when token duplicates type #12

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

Merged
merged 14 commits into from
Jan 16, 2024

Conversation

thiagomini
Copy link
Contributor

closes #2

@thiagomini thiagomini self-assigned this Dec 18, 2023
description: 'Ensure proper use of the @Inject decorator',
recommended: 'recommended',
},
fixable: undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making this rule fixable in some cases would be nice too, @tuxmachine - but probably a work for another issue, since it's a bit harder to do it

Copy link
Collaborator

@rickdgeerling rickdgeerling left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@@ -55,3 +55,22 @@ export function firstAssignmentExpressionInParentChain(
AST_NODE_TYPES.AssignmentExpression
);
}

export function injectDecoratorFor(node: TSESTree.Node) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🌽 Corn: Non-blocking, stylistic preference or nitpick

My feedback is categorized into one of five levels:

  • 🌱 Non-blocking, question
  • 🌽 Corn: Non-blocking, stylistic preference or nitpick
  • 🥚 Egg: Non-blocking, future consideration
  • 🐤 Chick: Non-blocking, requires future action
  • 🐔 Chicken: Blocking
  • 🦕 Dinosaur: Blocking, requires immediate action

See https://www.swyx.io/writing/feedback-ladders/

Can we rename this function to suggest that it returns the @Inject decorator. Now the name suggests that it injects a given decorator, so I was already looking for a second parameter 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh, good catch, I didn't notice that 'inject' could read as a verb here haha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ✅

…hub.com:TrilonIO/eslint-plugin into feat/rule-for-correct-usage-of-inject-decorator
@thiagomini thiagomini marked this pull request as ready for review January 16, 2024 11:30
@thiagomini thiagomini merged commit 89edbd8 into main Jan 16, 2024
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.

Create rule for correct usage of @Inject
2 participants