stricter increment lint #728
We should apply the same pattern below as well, keeping consistency for "increment"/"decrement"/"increase"/"decrease" checks.
{
- pattern: /\b[Dd]ecrement\b/gu,
+ pattern: /\b[Dd]ecrement _/gu,
message: 'prefer "set _x_ to _x_ - 1" over "decrement"',
},
Disagree: "increment" a noun that's reasonable to use in algorithms e.g. as a record name; "decrement" is not. (I suppose I could imagine "increase" or "decrease" being used as nouns but it'd be a stretch.)
[[Decrement]] is absolutely a reasonable record field name, and even if it weren't I'd still be arguing for consistency here to avoid confusion about what sets "decrement" apart—especially since all the cases we care about catching are still covered by /\b[Dd]ecrement _/gu.
I imagine I would object to a record field named [[Decrement]], but I also think we should lint against increment/decrement equally.
OK, done.
Approved these changes.
michaelficarra
bakkot
Fixes https://github.com/tc39/ecmarkup/issues/725.