-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix false positives with nested modules in no-identical-names
rule
#123
Fix false positives with nested modules in no-identical-names
rule
#123
Conversation
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.
Thanks for contributing! I just have one question about a test case that seems like it should be invalid to me, but it is currently valid. Please let me know what you think.
`, | ||
outdent` | ||
module("name1", function() { | ||
module("name1", function() {}); |
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'm not sure this should be a valid case. We definitely want to support submodules with the same name under nested modules because there's no chance for ambiguity when you look at the nested module stacks. But I'm not sure that is the case for a nested submodule with the same name as an ancestor module.
What do you think?
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.
Yeah I'd be open to flagging this case as a violation. But we should do that in a separate PR. My current PR is about fixing false positives whereas this change would be fixing a false negative.
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.
Sounds good, but would you mind removing this new "valid" test case from this PR in that case? That's just in case I lose track of things and cut a release after merging this PR but before we fix the issue I've raised.
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.
Sure! I removed this test case to avoid confusion.
5c73825
to
43eba2a
Compare
43eba2a
to
b8b759d
Compare
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.
Looks good, thanks for contributing!
Fixes #120.
CC: @mongoose700