@nodeve/checks 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/.vale.ini +59 -0
  2. package/README.md +21 -11
  3. package/dist/bin/prose.d.ts +3 -0
  4. package/dist/bin/prose.d.ts.map +1 -0
  5. package/dist/bin/prose.js +27 -0
  6. package/dist/bin/prose.js.map +1 -0
  7. package/dist/checks/catalog.d.ts.map +1 -1
  8. package/dist/checks/catalog.js.map +1 -1
  9. package/dist/checks/inline-dupes.d.ts.map +1 -1
  10. package/dist/checks/inline-dupes.js +26 -13
  11. package/dist/checks/inline-dupes.js.map +1 -1
  12. package/dist/checks/plural-arrays.d.ts.map +1 -1
  13. package/dist/checks/plural-arrays.js +26 -21
  14. package/dist/checks/plural-arrays.js.map +1 -1
  15. package/dist/checks/reshape.js.map +1 -1
  16. package/dist/lib/config.d.ts +4 -0
  17. package/dist/lib/config.d.ts.map +1 -1
  18. package/dist/lib/config.js.map +1 -1
  19. package/dist/lib/defaults.d.ts +1 -0
  20. package/dist/lib/defaults.d.ts.map +1 -1
  21. package/dist/lib/defaults.js +3 -0
  22. package/dist/lib/defaults.js.map +1 -1
  23. package/lefthook.checks.yml +42 -1
  24. package/nodeve.checks.defaults.js +3 -0
  25. package/package.json +12 -6
  26. package/styles/nodeve/Ephemeral.yml +16 -0
  27. package/styles/nodeve/Filler.yml +26 -0
  28. package/styles/nodeve/Hedging.yml +39 -0
  29. package/styles/nodeve/Narration.yml +30 -0
  30. package/styles/nodeve/SentenceLength.yml +10 -0
  31. package/styles/proselint/Airlinese.yml +8 -0
  32. package/styles/proselint/AnimalLabels.yml +48 -0
  33. package/styles/proselint/Annotations.yml +9 -0
  34. package/styles/proselint/Apologizing.yml +8 -0
  35. package/styles/proselint/Archaisms.yml +52 -0
  36. package/styles/proselint/But.yml +8 -0
  37. package/styles/proselint/Cliches.yml +782 -0
  38. package/styles/proselint/CorporateSpeak.yml +30 -0
  39. package/styles/proselint/Currency.yml +5 -0
  40. package/styles/proselint/Cursing.yml +15 -0
  41. package/styles/proselint/DateCase.yml +7 -0
  42. package/styles/proselint/DateMidnight.yml +7 -0
  43. package/styles/proselint/DateRedundancy.yml +10 -0
  44. package/styles/proselint/DateSpacing.yml +7 -0
  45. package/styles/proselint/DenizenLabels.yml +52 -0
  46. package/styles/proselint/Diacritical.yml +95 -0
  47. package/styles/proselint/GenderBias.yml +45 -0
  48. package/styles/proselint/GroupTerms.yml +39 -0
  49. package/styles/proselint/Hedging.yml +8 -0
  50. package/styles/proselint/Hyperbole.yml +6 -0
  51. package/styles/proselint/Jargon.yml +11 -0
  52. package/styles/proselint/LGBTOffensive.yml +13 -0
  53. package/styles/proselint/LGBTTerms.yml +15 -0
  54. package/styles/proselint/Malapropisms.yml +8 -0
  55. package/styles/proselint/Needless.yml +358 -0
  56. package/styles/proselint/Nonwords.yml +38 -0
  57. package/styles/proselint/Oxymorons.yml +22 -0
  58. package/styles/proselint/P-Value.yml +6 -0
  59. package/styles/proselint/RASSyndrome.yml +30 -0
  60. package/styles/proselint/Skunked.yml +13 -0
  61. package/styles/proselint/Spelling.yml +17 -0
  62. package/styles/proselint/Typography.yml +11 -0
  63. package/styles/proselint/Uncomparables.yml +50 -0
  64. package/styles/proselint/Very.yml +6 -0
  65. package/styles/proselint/meta.json +15 -0
  66. package/styles/write-good/Cliches.yml +702 -0
  67. package/styles/write-good/E-Prime.yml +32 -0
  68. package/styles/write-good/Illusions.yml +11 -0
  69. package/styles/write-good/Passive.yml +183 -0
  70. package/styles/write-good/So.yml +5 -0
  71. package/styles/write-good/ThereIs.yml +6 -0
  72. package/styles/write-good/TooWordy.yml +221 -0
  73. package/styles/write-good/Weasel.yml +29 -0
  74. package/styles/write-good/meta.json +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodeve/checks",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Org-wide commit-gate checks (doc budgets, reshape/dup/helper smells, page size) and helper-index generators, driven by a per-repo config file and wired through lefthook.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,9 @@
15
15
  "files": [
16
16
  "dist",
17
17
  "lefthook.checks.yml",
18
- "nodeve.checks.defaults.js"
18
+ "nodeve.checks.defaults.js",
19
+ ".vale.ini",
20
+ "styles"
19
21
  ],
20
22
  "exports": {
21
23
  "./config": {
@@ -26,10 +28,12 @@
26
28
  "types": "./dist/lib/defaults.d.ts",
27
29
  "default": "./dist/lib/defaults.js"
28
30
  },
29
- "./lefthook": "./lefthook.checks.yml"
31
+ "./lefthook": "./lefthook.checks.yml",
32
+ "./vale": "./.vale.ini"
30
33
  },
31
34
  "bin": {
32
35
  "nodeve-check": "./dist/bin/check.js",
36
+ "nodeve-prose": "./dist/bin/prose.js",
33
37
  "nodeve-check-doc-tokens": "./dist/bin/doc-tokens.js",
34
38
  "nodeve-check-commit-msg": "./dist/bin/commit-msg.js",
35
39
  "nodeve-check-reshape": "./dist/bin/reshape.js",
@@ -55,17 +59,19 @@
55
59
  "remeda": "^2.0.0",
56
60
  "ts-morph": "^28.0.0",
57
61
  "typescript": "^6.0.3",
58
- "yaml": "^2.5.0",
59
- "@nodeve/text": "2.1.0"
62
+ "yaml": "^2.9.0",
63
+ "@nodeve/text": "2.2.0"
60
64
  },
61
65
  "devDependencies": {
62
66
  "@types/node": "^24.0.0",
63
67
  "@types/pluralize": "^0.0.33",
64
- "@nodeve/config": "0.5.0"
68
+ "@nodeve/config": "0.5.1"
65
69
  },
66
70
  "scripts": {
67
71
  "build": "tsc -p tsconfig.json && cp dist/lib/defaults.js nodeve.checks.defaults.js",
68
72
  "clean": "rm -rf dist",
73
+ "sync-styles": "node bin/sync-styles.mjs",
74
+ "check": "pnpm typecheck",
69
75
  "typecheck": "tsc -p tsconfig.json --noEmit"
70
76
  }
71
77
  }
@@ -0,0 +1,16 @@
1
+ # Flag ephemeral-state language in docs. Docs are written BEFORE a commit but
2
+ # PERSIST after it — so any word framing the doc's moment as transient goes stale
3
+ # the instant it lands. "Uncommitted" describes a git state that ends at commit;
4
+ # "this session" names a working context that's gone by the next reader. Neither
5
+ # has a referent in a saved doc. State the durable fact, not the moment you wrote it.
6
+ extends: existence
7
+ message: "'%s' is transient — docs persist; state durable facts."
8
+ ignorecase: true
9
+ level: error
10
+ nonword: true
11
+ tokens:
12
+ - '\buncommitted\b'
13
+ - '\bthis session\b'
14
+ - '\bHandoff \b'
15
+ - '\bunblocked\b'
16
+ - '\bnext step\b'
@@ -0,0 +1,26 @@
1
+ # Flag low-value filler that survives write-good/proselint — phrases that add words
2
+ # without adding meaning. The house test: cut the phrase, does meaning survive? If
3
+ # yes it's fat. These fire where the wordier gates stay silent. Anchored so real
4
+ # uses ("in order theory", "make sure the flag is set" as an assertion) don't fire.
5
+ extends: existence
6
+ message: "'%s' is filler — cut it or state the fact plainly."
7
+ ignorecase: true
8
+ level: error
9
+ nonword: true
10
+ tokens:
11
+ # "in order to" → "to"; "so as to" → "to".
12
+ - '\bin order to\b'
13
+ - '\bso as to\b'
14
+ # Meta-throat-clearing before the actual statement.
15
+ - '\bnote that\b'
16
+ - '\bit(''s| is) worth noting that\b'
17
+ - '\bkeep in mind that\b'
18
+ - '\bplease note\b'
19
+ # Instruction narration — narrate the act instead of stating the value.
20
+ # "make sure to X" → "X"; "be sure to X" → "X".
21
+ - '\b(make|be) sure (to|that)\b'
22
+ - '\bmake sure you\b'
23
+ # Empty intensifiers past write-good.Weasel's set.
24
+ - '\bat the end of the day\b'
25
+ - '\bfor what it(''s| is) worth\b'
26
+ - '\bneedless to say\b'
@@ -0,0 +1,39 @@
1
+ # Flag deferred-decision hedges — phrases that punt a call the doc should MAKE.
2
+ # "Rebuild the pipeline if wanted" leaves the reader to decide whether it's wanted;
3
+ # either commit ("Rebuild the pipeline") or drop it. This is distinct from
4
+ # proselint.Hedging (vague-language weasels like "so to speak") — this rule targets
5
+ # optionality that defers a design decision. ADD phrases below; keep them anchored
6
+ # so legitimate conditional prose ("if needed for X") still reads.
7
+ extends: existence
8
+ message: "'%s' defers a decision — make the call (commit or cut) before commit."
9
+ ignorecase: true
10
+ level: error
11
+ nonword: true
12
+ # Optionality of any form. "if you want per-group albums, do X" is still a deferred
13
+ # call — say who the feature is for and commit, don't offload the choice to the
14
+ # reader. Both dangling ("do X if wanted") and object ("if you want X") forms fire.
15
+ tokens:
16
+ - '\bif wanted\b'
17
+ - '\bif desired\b'
18
+ - '\bas (wanted|desired)\b'
19
+ - '\b(if|as|when) (you )?(want|like|prefer|wish)\b'
20
+ - '\bif (you )?feel like it\b'
21
+ - '\bif that(''s| is) (wanted|desired|preferred)\b'
22
+ # Epistemic / vagueness hedges — soften a claim the doc should state plainly.
23
+ # ("completely" is left to write-good.Weasel to avoid a double-flag.)
24
+ - '\bappears to be\b'
25
+ - '\bseems to\b'
26
+ - '\bprobably\b'
27
+ - '\bbasically\b'
28
+ - '\bessentially\b'
29
+ - '\btotally\b'
30
+ - '\bsomewhat\b'
31
+ - '\bmight possibly\b'
32
+ - '\barguably\b'
33
+ - '\blikely\b'
34
+ - '\bin general\b'
35
+ - '\bgenerally speaking\b'
36
+ # Minimizing "just get" — the diminutive "just" plus a limp "get" softens the
37
+ # statement ("changes just get a version bump" → "changes get a version bump").
38
+ # State the action plainly; drop the "just".
39
+ - '\bjust gets?\b'
@@ -0,0 +1,30 @@
1
+ # Flag narration of a PRIOR version — prose that talks to the doc's own edit
2
+ # history instead of stating the current fact. A doc is read fresh, current-
3
+ # version-only: the reader never saw the copy you're correcting, so "this used to
4
+ # …", "no longer …", "RESOLVED", "revised — …", "correction:" inform nobody, turn
5
+ # a spec into a changelog, and cost tokens for zero present-tense content. Git
6
+ # holds the history; the doc holds the state. Rewrite to the bare fact. Distinct
7
+ # from Familiar.Ephemeral (transient-MOMENT words) — this targets backward-looking
8
+ # CORRECTION. Keep tokens anchored so legitimate present-tense use survives (a DNS
9
+ # name that "resolved", a promise that "resolves").
10
+ extends: existence
11
+ message: "'%s' narrates a past version — state the current fact; git holds the history."
12
+ ignorecase: true
13
+ level: error
14
+ nonword: true
15
+ tokens:
16
+ # Backward-reference: the sentence points at an earlier state the reader can't see.
17
+ - '\bno longer\b'
18
+ - '\bused to\b'
19
+ - '\bpreviously\b'
20
+ - '\bwas previously\b'
21
+ - '\bformerly\b'
22
+ - '\bre-?named from\b'
23
+ - '\bwas re-?named\b'
24
+ - '\bas (noted|mentioned) (above|earlier|before)\b'
25
+ # Status / revision markers — meta-commentary on the doc's own resolution.
26
+ - '\bcorrection:'
27
+ - '\bnow resolved\b'
28
+ - '\bnot open\b'
29
+ - '\((revised|resolved|updated|corrected)\b'
30
+ - '\b(revised|resolved) —'
@@ -0,0 +1,10 @@
1
+ # Flag over-long sentences — a telegraphic style keeps them short. Fires when a
2
+ # sentence exceeds `max` words. RAISE `max` if this is too aggressive on design
3
+ # prose, or lower it to tighten. Set level to suggestion to make it advisory.
4
+ extends: occurrence
5
+ message: 'Sentence is long (over 30 words) — split it or cut fat.'
6
+ level: error
7
+ # Match a run of non-terminal chars ending in sentence punctuation.
8
+ scope: sentence
9
+ token: '\b(\w+)\b'
10
+ max: 30
@@ -0,0 +1,8 @@
1
+ extends: existence
2
+ message: "'%s' is airlinese."
3
+ ignorecase: true
4
+ level: error
5
+ tokens:
6
+ - enplan(?:e|ed|ing|ement)
7
+ - deplan(?:e|ed|ing|ement)
8
+ - taking off momentarily
@@ -0,0 +1,48 @@
1
+ extends: substitution
2
+ message: "Consider using '%s' instead of '%s'."
3
+ level: error
4
+ action:
5
+ name: replace
6
+ swap:
7
+ (?:bull|ox)-like: taurine
8
+ (?:calf|veal)-like: vituline
9
+ (?:crow|raven)-like: corvine
10
+ (?:leopard|panther)-like: pardine
11
+ bird-like: avine
12
+ centipede-like: scolopendrine
13
+ crab-like: cancrine
14
+ crocodile-like: crocodiline
15
+ deer-like: damine
16
+ eagle-like: aquiline
17
+ earthworm-like: lumbricine
18
+ falcon-like: falconine
19
+ ferine: wild animal-like
20
+ fish-like: piscine
21
+ fox-like: vulpine
22
+ frog-like: ranine
23
+ goat-like: hircine
24
+ goose-like: anserine
25
+ gull-like: laridine
26
+ hare-like: leporine
27
+ hawk-like: accipitrine
28
+ hippopotamus-like: hippopotamine
29
+ lizard-like: lacertine
30
+ mongoose-like: viverrine
31
+ mouse-like: murine
32
+ ostrich-like: struthionine
33
+ peacock-like: pavonine
34
+ porcupine-like: hystricine
35
+ rattlesnake-like: crotaline
36
+ sable-like: zibeline
37
+ sheep-like: ovine
38
+ shrew-like: soricine
39
+ sparrow-like: passerine
40
+ swallow-like: hirundine
41
+ swine-like: suilline
42
+ tiger-like: tigrine
43
+ viper-like: viperine
44
+ vulture-like: vulturine
45
+ wasp-like: vespine
46
+ wolf-like: lupine
47
+ woodpecker-like: picine
48
+ zebra-like: zebrine
@@ -0,0 +1,9 @@
1
+ extends: existence
2
+ message: "'%s' left in text."
3
+ ignorecase: false
4
+ level: error
5
+ tokens:
6
+ - XXX
7
+ - FIXME
8
+ - TODO
9
+ - NOTE
@@ -0,0 +1,8 @@
1
+ extends: existence
2
+ message: "Excessive apologizing: '%s'"
3
+ ignorecase: true
4
+ level: error
5
+ action:
6
+ name: remove
7
+ tokens:
8
+ - More research is needed
@@ -0,0 +1,52 @@
1
+ extends: existence
2
+ message: "'%s' is archaic."
3
+ ignorecase: true
4
+ level: error
5
+ tokens:
6
+ - alack
7
+ - anent
8
+ - begat
9
+ - belike
10
+ - betimes
11
+ - boughten
12
+ - brocage
13
+ - brokage
14
+ - camarade
15
+ - chiefer
16
+ - chiefest
17
+ - Christiana
18
+ - completely obsolescent
19
+ - cozen
20
+ - divers
21
+ - deflexion
22
+ - fain
23
+ - forsooth
24
+ - foreclose from
25
+ - haply
26
+ - howbeit
27
+ - illumine
28
+ - in sooth
29
+ - maugre
30
+ - meseems
31
+ - methinks
32
+ - nigh
33
+ - peradventure
34
+ - perchance
35
+ - saith
36
+ - shew
37
+ - sistren
38
+ - spake
39
+ - to wit
40
+ - verily
41
+ - whilom
42
+ - withal
43
+ - wot
44
+ - enclosed please find
45
+ - please find enclosed
46
+ - enclosed herewith
47
+ - enclosed herein
48
+ - inforce
49
+ - ex postfacto
50
+ - foreclose from
51
+ - forewent
52
+ - for ever
@@ -0,0 +1,8 @@
1
+ extends: existence
2
+ message: "Do not start a paragraph with a 'but'."
3
+ level: error
4
+ scope: paragraph
5
+ action:
6
+ name: remove
7
+ tokens:
8
+ - ^But