-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add linter for duplicate features #4200
Comments
I'm pretty sure I suggested a fix for this at some point before, but it was about requiring that the filename and main feature name match, and that was too likely to have false positives. Hopefully this one would work better? :) |
I think part of the thinking behind having the full hierarchy in every file was that we might want to split up very large APIs into multiple files (for instance, splitting subfeatures of |
@ddbeck it shouldn’t effect that use case since we’d only want to detect duplication at the tips of the tree, so you could separate subfeatures of a feature into multiple files, and it wouldn’t trigger the linter unless you repeated the parent feature’s support info or had the same subfeature in multiple files. |
🤦♂ OK, yeah, that makes sense! I misunderstood this as detecting duplication of a |
I probably could have been more clear on that point :) |
This becomes a higher priority with the new mixin approach: #8929 |
Duplicate features across multiple files has been basically disallowed by #9821, and a better error message for it in #15479. Duplicate features in the same file are still "allowed", but will be resolved by |
With the better error message in #15479, I think that this has been resolved! |
For example, if someone copy-pastes an existing JSON file when tracking a new feature (which I definitely have done a lot) and then forgets to change the feature title, you could have the same feature path (e.g.
css.properties.-webkit-box-reflect
) for two separate features.I don't think this would ever cause false-positives, since as far as I know you're never supposed to have duplicate feature names anyway.
I'm not sure how exactly to write a performant means of doing this, but I imagine someone smarter than me could figure it out :)
This would help detect issues like the one fixed in #4199.
The text was updated successfully, but these errors were encountered: