@heyramzi/lint 2.11.7 → 2.12.0
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.
- package/data/slop/patterns/plain-structure.js +68 -0
- package/data/slop/patterns.js +2 -0
- package/data/slop/phrases-en-closers.js +12 -3
- package/data/slop/words-en.js +11 -0
- package/package.json +1 -1
- package/slop.js +29 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The structure half of plain English, from Dodaios/ste80-humanizer (MIT), read 14 Nov 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Its point, which the word lists can't hold: word habits change with every model release and structural ones stay. A draft
|
|
7
|
+
* scrubbed of "delve" still carries the buried verb, the stacked hedge and the semicolon. These are the parts of its Simplified
|
|
8
|
+
* Technical English pass that have a literal signature. The rest (one idea per sentence, condition before command, noun stacks)
|
|
9
|
+
* is a read, in the humanizer's `patterns.md` 73 to 77.
|
|
10
|
+
*/
|
|
11
|
+
export const patternsPlainStructure = [
|
|
12
|
+
{
|
|
13
|
+
id: "semicolon",
|
|
14
|
+
name: "Semicolon",
|
|
15
|
+
view: "prose",
|
|
16
|
+
// English sets a semicolon tight against the word before it; French sets it after a space ("mot ; mot"), so the
|
|
17
|
+
// no-space-before rule keeps French typography out. An HTML entity (` `) and a CSS or type declaration (`flex; gap:`) aren't prose.
|
|
18
|
+
test: /[^\n.!?;]{0,30}[\p{L}\p{N})"'’”](?<!&#?\w+);(?![ \t]+[\w-]+[ \t]*:)[ \t]+["'“‘(]?\p{L}[^\n.!?;]{0,30}/u,
|
|
19
|
+
rule: "A semicolon joining two clauses. Ramzi's 2026 writing has none, so one marks the piece as somebody else's (anti-voice 3), and plain English bans it outright. Write two sentences, or a list.",
|
|
20
|
+
example:
|
|
21
|
+
'"The cache is warm; the request is fast." / "We tried it twice; it broke both times."',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "split-contrast",
|
|
25
|
+
name: "This doesn't mean X. It means Y.",
|
|
26
|
+
// The negation pivot spread over two sentences, so the comma form (`comma-not-pivot`) never sees it.
|
|
27
|
+
test: /\b(?:this|that|it)\s+(?:doesn't|does\s+not|didn't|did\s+not|isn't|is\s+not|wasn't|was\s+not)\s+(?:mean|about)\b[^.!?\n]{0,140}[.!?]\s+(?:it|this|that)(?:'s|\s+is|\s+was)?\s+(?:means?|meant|about)\b/i,
|
|
28
|
+
rule: "A negation pivot split across two sentences: the first denies a reading nobody offered so the second sounds bigger. State the second sentence alone.",
|
|
29
|
+
example:
|
|
30
|
+
'"This doesn\'t mean tests are optional. It means the linter catches the easy errors first." / "It isn\'t about speed. It\'s about trust."',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "stacked-hedge",
|
|
34
|
+
name: "Stacked hedge",
|
|
35
|
+
// A modal is already a hedge, so a second one after it is padding. Replaces the 2 fixed phrases ("could potentially",
|
|
36
|
+
// "might arguably") that missed "may possibly" and "could perhaps".
|
|
37
|
+
test: /\b(?:could|may|might)\s+(?:potentially|possibly|perhaps|arguably|conceivably)\b/i,
|
|
38
|
+
rule: 'Two hedges on one verb. Keep the one the source supports, at its strength: "could potentially break" is "can break", never "breaks".',
|
|
39
|
+
example:
|
|
40
|
+
'"This change could potentially break requests." / "It may possibly help." / "That might arguably work."',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "buried-verb",
|
|
44
|
+
name: "The action in a noun",
|
|
45
|
+
// The verb that carries no meaning, then the noun that does. Bounded to nouns that have a plain verb of their own, so
|
|
46
|
+
// "make a plan" and "run an audit" pass.
|
|
47
|
+
test: /\b(?:make|makes|made|making)\s+(?:a|the)\s+(?:decision|determination|assessment|adjustment|modification|recommendation)\b|\b(?:perform|performs|performed|performing|carry\s+out|carries\s+out|carried\s+out|carrying\s+out|undertake|undertakes|undertook|conduct|conducts|conducted)\s+(?:a|an|the)\s+(?:[a-z-]+\s+)?(?:analysis|review|installation|evaluation|assessment|examination|investigation|implementation|migration|inspection|calculation|verification)\b|\bmake\s+use\s+of\b|\b(?:give|gives|gave|giving)\s+consideration\s+to\b|\btake\s+into\s+consideration\b|\b(?:reach|reached|reaches|come\s+to|came\s+to)\s+a\s+conclusion\b/i,
|
|
48
|
+
rule: 'The action buried in a noun behind an empty verb. Put it back in the verb: "make a decision" is "decide", "perform an analysis of" is "analyse", "make use of" is "use".',
|
|
49
|
+
example:
|
|
50
|
+
'"We need to make a decision by Friday." / "The team will perform an analysis of churn." / "We make use of one template." / "We carried out a review of the contracts."',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "fragment-row",
|
|
54
|
+
name: "No X. No Y. No Z.",
|
|
55
|
+
// Capital N keeps it to sentence starts. Three in a row is the shape; one "No setup." is a fragment a person writes.
|
|
56
|
+
test: /\bNo\s+[\w'-]+(?:\s+[\w'-]+)?[.!]\s+No\s+[\w'-]+(?:\s+[\w'-]+)?[.!]\s+No\s+[\w'-]+|\bPas\s+de\s+[\p{L}'-]+[.!]\s+Pas\s+de\s+[\p{L}'-]+[.!]\s+Pas\s+de\b/u,
|
|
57
|
+
rule: "A row of negated fragments standing in for a claim. Merge them into one sentence that says what the thing does instead.",
|
|
58
|
+
example: '"No setup. No config. No waiting." / "No cold starts. No regions. No excuses."',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "staged-candor",
|
|
62
|
+
name: "Honestly?",
|
|
63
|
+
// The standalone question form only. "Honestly" inside a sentence is how people talk (detection.md, "Don't flag these").
|
|
64
|
+
test: /\b(?:honestly|seriously|frankly|truthfully)\?(?=\s|$)/i,
|
|
65
|
+
rule: "Candour staged as a one-word question before a routine answer. A person being honest just says the thing.",
|
|
66
|
+
example: '"Is the paid plan worth it? Honestly? It depends on your team." / "Seriously? Yes."',
|
|
67
|
+
},
|
|
68
|
+
];
|
package/data/slop/patterns.js
CHANGED
|
@@ -12,6 +12,7 @@ import { patternsParallelShapes } from "#lint/data/slop/patterns/parallel-shapes
|
|
|
12
12
|
import { patternsDroppedElements } from "#lint/data/slop/patterns/dropped-elements.js";
|
|
13
13
|
import { patternsDurationAndOpeners } from "#lint/data/slop/patterns/duration-and-openers.js";
|
|
14
14
|
import { patternsDiagramAndScriptTells } from "#lint/data/slop/patterns/diagram-and-script-tells.js";
|
|
15
|
+
import { patternsPlainStructure } from "#lint/data/slop/patterns/plain-structure.js";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* The sentence shapes that CAN be matched exactly, so they are linted rather than left to a human read.
|
|
@@ -63,4 +64,5 @@ export const patterns = [
|
|
|
63
64
|
...patternsDroppedElements,
|
|
64
65
|
...patternsDurationAndOpeners,
|
|
65
66
|
...patternsDiagramAndScriptTells,
|
|
67
|
+
...patternsPlainStructure,
|
|
66
68
|
];
|
|
@@ -10,6 +10,17 @@ export const phrasesEnClosers = [
|
|
|
10
10
|
"what really matters",
|
|
11
11
|
"the deeper issue",
|
|
12
12
|
"the heart of the matter",
|
|
13
|
+
"that's the power of",
|
|
14
|
+
"that is the power of",
|
|
15
|
+
// Long phrases with a short word of their own (ste80-humanizer's plain-word swaps, 14 Nov 2026).
|
|
16
|
+
"in order to",
|
|
17
|
+
"prior to",
|
|
18
|
+
"due to the fact that",
|
|
19
|
+
"in the event that",
|
|
20
|
+
"it should be noted",
|
|
21
|
+
"at this point in time",
|
|
22
|
+
"for the purpose of",
|
|
23
|
+
"with the exception of",
|
|
13
24
|
// Staged run-ups before the point.
|
|
14
25
|
"let's explore",
|
|
15
26
|
"let's break this down",
|
|
@@ -26,9 +37,7 @@ export const phrasesEnClosers = [
|
|
|
26
37
|
"a tempting approach",
|
|
27
38
|
"one might be tempted",
|
|
28
39
|
"it would be easy to just",
|
|
29
|
-
// Stacked qualifiers.
|
|
30
|
-
"could potentially",
|
|
31
|
-
"might arguably",
|
|
40
|
+
// Stacked qualifiers. A modal plus a second hedge is the `stacked-hedge` pattern.
|
|
32
41
|
"this is an inference",
|
|
33
42
|
// Send-off inflation and sales language.
|
|
34
43
|
"the future looks bright",
|
package/data/slop/words-en.js
CHANGED
|
@@ -175,6 +175,17 @@ export const wordsEn = [
|
|
|
175
175
|
"underpins",
|
|
176
176
|
"valuable",
|
|
177
177
|
"vibrant",
|
|
178
|
+
// --- Long words doing a short word's job (ste80-humanizer, 14 Nov 2026). Not "utilise" or "commence", French verbs, or "utilization", an agency metric ---
|
|
179
|
+
"leverages",
|
|
180
|
+
"leveraged",
|
|
181
|
+
"utilised",
|
|
182
|
+
"utilising",
|
|
183
|
+
"utilized",
|
|
184
|
+
"utilizes",
|
|
185
|
+
"commenced",
|
|
186
|
+
"subsequently",
|
|
187
|
+
"world-class",
|
|
188
|
+
"stunning",
|
|
178
189
|
// --- Stock demo companies: every AI demo reaches for them (Ramzi, 12 Nov 2026) ---
|
|
179
190
|
"northwind",
|
|
180
191
|
"larkspur",
|
package/package.json
CHANGED
package/slop.js
CHANGED
|
@@ -192,6 +192,21 @@ function auditStructure(text, language) {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
// A heading, then a short line that says it again ("## Security" then "Security is important."). Patterns.md 29.
|
|
196
|
+
for (const heading of headings) {
|
|
197
|
+
const next = body
|
|
198
|
+
.slice(heading.at)
|
|
199
|
+
.split(/\n[ \t]*\n/)
|
|
200
|
+
.slice(1)
|
|
201
|
+
.find((p) => p.trim())
|
|
202
|
+
?.trim();
|
|
203
|
+
if (!next || /\d|^#/.test(next) || next.split(/\s+/).length > 7) continue;
|
|
204
|
+
const title = escapeRe(heading.title.replace(/[.:!?]+$/, ""));
|
|
205
|
+
if (new RegExp(`^${title}\\s+(?:is|are|matters?|counts?)\\b`, "i").test(next)) {
|
|
206
|
+
hit("heading-echo", `${heading.title}: ${next}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
195
210
|
const bold = [...withoutCode(body).matchAll(/\*\*[^*\n]{2,}\*\*/g)];
|
|
196
211
|
// Japanese and Chinese put no spaces between words, so a whitespace split read a 3,500 character article as 256 words and failed all 15 Japanese pages on the site for
|
|
197
212
|
|
|
@@ -327,6 +342,20 @@ export function auditSlop(draft, { code = false, language: declared, all = false
|
|
|
327
342
|
const around = source.slice(Math.max(0, m.index - 30), m.index + 30);
|
|
328
343
|
add("dash", "em-or-en-dash", around, all && lines.lineOf(m.index), upTo(m));
|
|
329
344
|
}
|
|
345
|
+
// A spaced double hyphen is the dash typed on a keyboard without one. Letters on both sides keep `build -- --watch` out.
|
|
346
|
+
const dashProse = code ? copyStrings(text) : withoutCode(text);
|
|
347
|
+
for (const m of dashProse.matchAll(/(?<=[\p{L}\p{N},.)"'’]) -- (?=[\p{L}\p{N}("'‘])/gu)) {
|
|
348
|
+
const lineStart = dashProse.lastIndexOf("\n", m.index) + 1;
|
|
349
|
+
const around = dashProse.slice(Math.max(lineStart, m.index - 30), m.index + 30);
|
|
350
|
+
const needle = dashProse.slice(Math.max(lineStart, m.index - 20), m.index + 4);
|
|
351
|
+
add(
|
|
352
|
+
"dash",
|
|
353
|
+
"double-hyphen-dash",
|
|
354
|
+
around,
|
|
355
|
+
all && lines.find("double-hyphen-dash", needle),
|
|
356
|
+
needle,
|
|
357
|
+
);
|
|
358
|
+
}
|
|
330
359
|
for (const m of text.matchAll(EMOJI)) {
|
|
331
360
|
const around = source.slice(Math.max(0, m.index - 30), m.index + 30);
|
|
332
361
|
add("emoji", "emoji", around, all && lines.lineOf(m.index), upTo(m));
|