Repository navigation
Conversation
| name = "first" | ||
| version = "0.1.0" | ||
| entrypoint = "lib.typ" | ||
| compiler = "0.13.1" |
There was a problem hiding this comment.
Is there a reason to include that change in this PR?
There was a problem hiding this comment.
The lint was previously tested on itemize, but it produced many kebab-case warnings and the snapshot got a bit noisy, so I removed it. Similarly for elembic, which tested the Typst in description lint.
| /// SCREAMING-KEBAB-CASE. | ||
| fn is_recommended_binding_name(ident: &str) -> bool { | ||
| let ident = trim_underscores(ident); | ||
| is_lower_kebab_case(ident) || is_upper_kebab_case(ident) || is_upper_snake_case(ident) |
There was a problem hiding this comment.
I'm not 100% sure we should keep allowing UPPER_SNAKE_CASE. It seems more natural to write (at least for me), but it is also inconsistent with the general rule. With lint filtering, it would also be possible to write a regex to allow for it if really needed.
There was a problem hiding this comment.
Yeah, I would also be fine with removing it. Maybe we should then also remove the leading and trailing underscore support? It seems easy enough two write something like allow-matches = ["_[a-z][a-z0-9]*(_[a-z0-9]+)*"]
There was a problem hiding this comment.
I disallowed UPPER_SNAKE_CASE
Closes #91
I've tweaked the checks a little bit to allow for leading and trailing underscores. Let me know what you think of that.