Closed JulianCataldo closed 2 years ago
Hi! It seems some of the things asked in the template are missing? Please edit your post to fill out everything.
You won’t get any more notifications from me, but I’ll keep on updating this comment, and remove it when done!
Thanks, — bb
Merging #78 (28690c1) into main (0a3f1d4) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #78 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 71 71
=========================================
Hits 71 71
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Cool, looks useful!
Expected casing of `${correctOne}` instead of `${original}`
actual
, expected
, and url
fields to messages.
actual
is supposed to hold the actual value in the document: toString(nodes)
expected
is supposed to hold the suggestion (an array of strings or one string): correctOne
url
can go to documentation, preferrably specific to the ruleId
if (nodes[0].type === 'WordNode') {
? I don’t think that’s every false
?Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/*
labels.
options.ignore
, which similar plugins supports too. E.g., https://github.com/retextjs/retext-passive#optionsignorecase-police
seems to do some fancy things on which casings they include and which they ignore: https://github.com/antfu/case-police/blob/6cfa330a55e987038d1a618cb163ebadfa8fbbae/src/utils.ts#L46-L54. Maybe good to add some tests for that?
- I’m not sure why you’re checking if (nodes[0].type === 'WordNode') {? I don’t think that’s every false?
Good question. I've added it after trial and error, for making ESLint happy 🤔 Even if it feels redundant. Smash that squiggles 😄
This can likely be solved by using nodes[0]
as the place, instead of delving into it.
A word like don’t
, consists of text("don"), punctuation("’"), text("t")
. Right now you are warning about don
, but the warning is instead about the whole word?
Oh, neat! I wasn't conscious of what you are describing. So ESLint was right bothering me, even if for me, it wasn't clear why ^^
Did a quick try, and it does address this, indeed, while being more robust, even if the children[0]
didn't seems to cause side-effects. I always observed singleton in node[0]
, maybe because case-police
dictionaries are alphabetical only, without any embedded punctuation in tokens.
thx 👍
Initial checklist
Description of changes
Repository
A
retext
plugin for checking popular names casing.Examples:
macbook
→ ✅MacBook
MacOS
→ ✅macOS
For:
Dictionaries are from
case-police
.