-
Notifications
You must be signed in to change notification settings - Fork 457
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
No unused attribute warning for attributes without "bs." prefix #6636
Comments
Actually this is not completely done yet. I have not activated the check for |
As stated above, the unused unused attribute checks are currently still disabled for I now looked into However, this won't work as the former is in How to best resolve this? @cristianoc |
One possibility is to add a callback into let mark_used_bs_attribute_ref : (Parsetree.attribute -> unit) ref = ref (fun _ -> ()) Then set it in let mark_used_bs_attribute ((x, _) : Parsetree.attribute) =
if not x.loc.loc_ghost then Hash_set_poly.add used_attributes x
let () = Ast_untagged_variants.mark_used_bs_attribute_ref := mark_used_bs_attribute That said it's not completely clear what future uses of |
So are you in favor of fixing this? Personally I find the unused attribute warnings quite helpful. 3rd party PPXs should use different/"namespaced" attribute names anyway IMHO. |
Sure it can be fixed. |
@cristianoc Thanks a lot! This solution is much better than the callback trick! 🎉 |
@cknitt moved the check earlier: into the invariant check code. |
Ok, so after #6795 and #6802, | "as" | "bs" | "config" | "ignore" | "inline" | "int" | "optional" | "string"
| "uncurry" | "unwrap" However, looking at https://rescript-lang.org/syntax-lookup, there are many more attributes. For which of these would it make sense to add checks? For example, what about |
I came across this while cleaning up the
bs.
prefix handling.gives
whereas
gives no error.
The text was updated successfully, but these errors were encountered: