-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: rule warns when token duplicates type #12
Conversation
description: 'Ensure proper use of the @Inject decorator', | ||
recommended: 'recommended', | ||
}, | ||
fixable: 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.
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
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.
LGTM 🚀
src/ast-traverser.util.ts
Outdated
@@ -55,3 +55,22 @@ export function firstAssignmentExpressionInParentChain( | |||
AST_NODE_TYPES.AssignmentExpression | |||
); | |||
} | |||
|
|||
export function injectDecoratorFor(node: TSESTree.Node) { |
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.
🌽 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
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 😄
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.
Ohh, good catch, I didn't notice that 'inject' could read as a verb here haha
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.
Done ✅
…hub.com:TrilonIO/eslint-plugin into feat/rule-for-correct-usage-of-inject-decorator
closes #2