slopless 0.2.6 → 0.2.8
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/README.md +65 -4
- package/dist/adapters/textlint/rule.js +21 -0
- package/dist/adapters/textlint/rule.js.map +1 -0
- package/dist/adapters/textlint/units.js +133 -1
- package/dist/adapters/textlint/units.js.map +1 -1
- package/dist/cli.js +77 -5
- package/dist/cli.js.map +1 -1
- package/dist/presets/everything.js +2 -0
- package/dist/presets/everything.js.map +1 -1
- package/dist/registries/orthography.js +4 -0
- package/dist/registries/orthography.js.map +1 -1
- package/dist/reporting/reports.js +50 -0
- package/dist/reporting/reports.js.map +1 -1
- package/dist/rules/academic-slop/tortured-phrases.js +13 -23
- package/dist/rules/academic-slop/tortured-phrases.js.map +1 -1
- package/dist/rules/metrics/avg-sentence-length.js +23 -21
- package/dist/rules/metrics/avg-sentence-length.js.map +1 -1
- package/dist/rules/metrics/coleman-liau.js +23 -23
- package/dist/rules/metrics/coleman-liau.js.map +1 -1
- package/dist/rules/metrics/flesch-kincaid.js +23 -23
- package/dist/rules/metrics/flesch-kincaid.js.map +1 -1
- package/dist/rules/metrics/gunning-fog.js +23 -23
- package/dist/rules/metrics/gunning-fog.js.map +1 -1
- package/dist/rules/metrics/paragraph-length.js +19 -20
- package/dist/rules/metrics/paragraph-length.js.map +1 -1
- package/dist/rules/metrics/word-repetition.js +20 -21
- package/dist/rules/metrics/word-repetition.js.map +1 -1
- package/dist/rules/narrative-slop/body-action-density.js +60 -23
- package/dist/rules/narrative-slop/body-action-density.js.map +1 -1
- package/dist/rules/narrative-slop/data/narrative-cliches.json +27 -0
- package/dist/rules/narrative-slop/flat-action-cadence.js +23 -26
- package/dist/rules/narrative-slop/flat-action-cadence.js.map +1 -1
- package/dist/rules/narrative-slop/narrative-cliches.js +35 -33
- package/dist/rules/narrative-slop/narrative-cliches.js.map +1 -1
- package/dist/rules/narrative-slop/perception-verb-density.js +22 -23
- package/dist/rules/narrative-slop/perception-verb-density.js.map +1 -1
- package/dist/rules/orthography/artifact-placeholders.js +110 -0
- package/dist/rules/orthography/artifact-placeholders.js.map +1 -0
- package/dist/rules/orthography/colon-dramatic.js +24 -32
- package/dist/rules/orthography/colon-dramatic.js.map +1 -1
- package/dist/rules/orthography/em-dashes.js +19 -33
- package/dist/rules/orthography/em-dashes.js.map +1 -1
- package/dist/rules/orthography/exclamation-density.js +20 -34
- package/dist/rules/orthography/exclamation-density.js.map +1 -1
- package/dist/rules/orthography/fake-timestamps.js +12 -32
- package/dist/rules/orthography/fake-timestamps.js.map +1 -1
- package/dist/rules/orthography/hidden-unicode-controls.js +51 -0
- package/dist/rules/orthography/hidden-unicode-controls.js.map +1 -0
- package/dist/rules/orthography/sentence-case.js +24 -32
- package/dist/rules/orthography/sentence-case.js.map +1 -1
- package/dist/rules/orthography/smart-quotes.js +12 -32
- package/dist/rules/orthography/smart-quotes.js.map +1 -1
- package/dist/rules/phrases/cliches.js +16 -27
- package/dist/rules/phrases/cliches.js.map +1 -1
- package/dist/rules/phrases/corporate-speak.js +16 -27
- package/dist/rules/phrases/corporate-speak.js.map +1 -1
- package/dist/rules/phrases/data/llm-disclaimer-expansions.json +9 -2
- package/dist/rules/phrases/data/redundancy-patterns.json +7 -0
- package/dist/rules/phrases/data/wordiness-patterns.json +2 -0
- package/dist/rules/phrases/humble-bragger.js +12 -22
- package/dist/rules/phrases/humble-bragger.js.map +1 -1
- package/dist/rules/phrases/jargon-faker.js +14 -25
- package/dist/rules/phrases/jargon-faker.js.map +1 -1
- package/dist/rules/phrases/llm-disclaimer.js +19 -23
- package/dist/rules/phrases/llm-disclaimer.js.map +1 -1
- package/dist/rules/phrases/prohibited-phrases.js +13 -23
- package/dist/rules/phrases/prohibited-phrases.js.map +1 -1
- package/dist/rules/phrases/redundancy.js +13 -23
- package/dist/rules/phrases/redundancy.js.map +1 -1
- package/dist/rules/phrases/skunked-terms.js +13 -23
- package/dist/rules/phrases/skunked-terms.js.map +1 -1
- package/dist/rules/phrases/uncomparables.js +15 -26
- package/dist/rules/phrases/uncomparables.js.map +1 -1
- package/dist/rules/phrases/wordiness.js +13 -23
- package/dist/rules/phrases/wordiness.js.map +1 -1
- package/dist/rules/private/textlint-rule-builders.js +46 -0
- package/dist/rules/private/textlint-rule-builders.js.map +1 -0
- package/dist/rules/semantic-thinness/patterns/puffery-evaluative-claim.json +56 -0
- package/dist/rules/semantic-thinness/private/pattern-data-d.js +2 -0
- package/dist/rules/semantic-thinness/private/pattern-data-d.js.map +1 -1
- package/dist/rules/semantic-thinness/semantic-thinness.js +27 -23
- package/dist/rules/semantic-thinness/semantic-thinness.js.map +1 -1
- package/dist/rules/syntactic-patterns/authority/authority-padding.js +19 -23
- package/dist/rules/syntactic-patterns/authority/authority-padding.js.map +1 -1
- package/dist/rules/syntactic-patterns/closers/affirmation-closers.js +45 -43
- package/dist/rules/syntactic-patterns/closers/affirmation-closers.js.map +1 -1
- package/dist/rules/syntactic-patterns/closers/boilerplate-conclusion.js +25 -22
- package/dist/rules/syntactic-patterns/closers/boilerplate-conclusion.js.map +1 -1
- package/dist/rules/syntactic-patterns/closers/false-question.js +20 -24
- package/dist/rules/syntactic-patterns/closers/false-question.js.map +1 -1
- package/dist/rules/syntactic-patterns/closers/summative-closer.js +20 -24
- package/dist/rules/syntactic-patterns/closers/summative-closer.js.map +1 -1
- package/dist/rules/syntactic-patterns/contrast/blame-reframe.js +19 -23
- package/dist/rules/syntactic-patterns/contrast/blame-reframe.js.map +1 -1
- package/dist/rules/syntactic-patterns/contrast/contrastive-aphorism.js +39 -31
- package/dist/rules/syntactic-patterns/contrast/contrastive-aphorism.js.map +1 -1
- package/dist/rules/syntactic-patterns/contrast/negation-reframe.js +12 -21
- package/dist/rules/syntactic-patterns/contrast/negation-reframe.js.map +1 -1
- package/dist/rules/syntactic-patterns/contrast/private/negation-reframe-parts.js +4 -2
- package/dist/rules/syntactic-patterns/contrast/private/negation-reframe-parts.js.map +1 -1
- package/dist/rules/syntactic-patterns/contrast/private/negative-slop-frames.js +33 -2
- package/dist/rules/syntactic-patterns/contrast/private/negative-slop-frames.js.map +1 -1
- package/dist/rules/syntactic-patterns/generalization/softening-language.js +19 -23
- package/dist/rules/syntactic-patterns/generalization/softening-language.js.map +1 -1
- package/dist/rules/syntactic-patterns/generalization/universalizing-claims.js +19 -23
- package/dist/rules/syntactic-patterns/generalization/universalizing-claims.js.map +1 -1
- package/dist/rules/syntactic-patterns/lead-ins/boilerplate-framing.js +12 -22
- package/dist/rules/syntactic-patterns/lead-ins/boilerplate-framing.js.map +1 -1
- package/dist/rules/syntactic-patterns/lead-ins/generic-signposting.js +19 -23
- package/dist/rules/syntactic-patterns/lead-ins/generic-signposting.js.map +1 -1
- package/dist/rules/syntactic-patterns/lead-ins/lesson-framing.js +19 -23
- package/dist/rules/syntactic-patterns/lead-ins/lesson-framing.js.map +1 -1
- package/dist/rules/syntactic-patterns/lead-ins/llm-openers.js +28 -25
- package/dist/rules/syntactic-patterns/lead-ins/llm-openers.js.map +1 -1
- package/dist/rules/syntactic-patterns/lead-ins/observer-guidance.js +19 -23
- package/dist/rules/syntactic-patterns/lead-ins/observer-guidance.js.map +1 -1
- package/dist/rules/syntactic-patterns/llm-artifacts/data/response-wrapper-patterns.json +6 -0
- package/dist/rules/syntactic-patterns/llm-artifacts/response-wrapper.js +21 -26
- package/dist/rules/syntactic-patterns/llm-artifacts/response-wrapper.js.map +1 -1
- package/dist/rules/syntactic-patterns/repetition/demonstrative-emphasis.js +28 -51
- package/dist/rules/syntactic-patterns/repetition/demonstrative-emphasis.js.map +1 -1
- package/dist/rules/syntactic-patterns/repetition/empty-emphasis.js +19 -23
- package/dist/rules/syntactic-patterns/repetition/empty-emphasis.js.map +1 -1
- package/dist/rules/syntactic-patterns/repetition/fragment-stacking.js +12 -32
- package/dist/rules/syntactic-patterns/repetition/fragment-stacking.js.map +1 -1
- package/dist/rules/syntactic-patterns/repetition/triple-repeat.js +15 -38
- package/dist/rules/syntactic-patterns/repetition/triple-repeat.js.map +1 -1
- package/dist/rules/term-policy/recommended-terms.js +24 -22
- package/dist/rules/term-policy/recommended-terms.js.map +1 -1
- package/dist/rules/term-policy/required-terms.js +20 -24
- package/dist/rules/term-policy/required-terms.js.map +1 -1
- package/dist/rules/words/hedge-stacking.js +19 -23
- package/dist/rules/words/hedge-stacking.js.map +1 -1
- package/dist/rules/words/llm-vocabulary.js +14 -20
- package/dist/rules/words/llm-vocabulary.js.map +1 -1
- package/dist/rules/words/prohibited-words.js +12 -17
- package/dist/rules/words/prohibited-words.js.map +1 -1
- package/dist/rules/words/simplicity.js +20 -25
- package/dist/rules/words/simplicity.js.map +1 -1
- package/package.json +5 -2
- package/skills/slopless/SKILL.md +63 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { documentText } from "../../shared/text/document.js";
|
|
2
1
|
import { normalizeForMatch } from "../../shared/text/normalize.js";
|
|
3
2
|
import { wordTokens } from "../../shared/text/tokens.js";
|
|
4
|
-
import {
|
|
3
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
5
4
|
const SUFFIXES = [
|
|
6
5
|
"ation",
|
|
7
6
|
"tion",
|
|
@@ -66,26 +65,29 @@ function countPresentTerms(text, policy) {
|
|
|
66
65
|
}
|
|
67
66
|
return count;
|
|
68
67
|
}
|
|
69
|
-
const rule = (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (policy === undefined) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const count = countPresentTerms(documentText(node), policy);
|
|
78
|
-
if (count >= policy.minCount) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
emitTextlintFinding(context, {
|
|
82
|
-
node: node,
|
|
83
|
-
ruleId: "term-policy:recommended-terms",
|
|
84
|
-
message: `Recommended terms present: ${count}. Include at least ${policy.minCount} terms from the policy pool.`,
|
|
85
|
-
range: { start: 0, end: 0 }
|
|
86
|
-
});
|
|
68
|
+
const rule = oneToOneRule({
|
|
69
|
+
detect: (unit, options) => {
|
|
70
|
+
const policy = configuredPolicy(options);
|
|
71
|
+
if (policy === undefined) {
|
|
72
|
+
return [];
|
|
87
73
|
}
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
const count = countPresentTerms(unit.text, policy);
|
|
75
|
+
if (count >= policy.minCount) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return [
|
|
79
|
+
{
|
|
80
|
+
data: { minCount: policy.minCount },
|
|
81
|
+
evidence: String(count),
|
|
82
|
+
label: "recommended terms",
|
|
83
|
+
range: { start: 0, end: 0 }
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
},
|
|
87
|
+
family: "term-policy",
|
|
88
|
+
formatMessage: (report) => `Recommended terms present: ${report.evidence}. Include at least ${report.detections[0]?.data?.["minCount"]} terms from the policy pool.`,
|
|
89
|
+
ruleId: "term-policy:recommended-terms",
|
|
90
|
+
unitKind: "document"
|
|
91
|
+
});
|
|
90
92
|
export default rule;
|
|
91
93
|
//# sourceMappingURL=recommended-terms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended-terms.js","sourceRoot":"","sources":["../../../src/rules/term-policy/recommended-terms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recommended-terms.js","sourceRoot":"","sources":["../../../src/rules/term-policy/recommended-terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAcpE,MAAM,QAAQ,GAAG;IACf,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;CACJ,CAAC;AAEF,SAAS,SAAS,CAAC,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AC5B;SACF,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,aAAa;IACrB,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,8BAA8B,MAAM,CAAC,QAAQ,sBAAsB,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,8BAA8B;IAC3I,MAAM,EAAE,+BAA+B;IACvC,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { documentText } from "../../shared/text/document.js";
|
|
2
1
|
import { normalizeForMatch } from "../../shared/text/normalize.js";
|
|
3
2
|
import { wordTokens } from "../../shared/text/tokens.js";
|
|
4
|
-
import {
|
|
3
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
5
4
|
function presentTerms(text) {
|
|
6
5
|
return new Set(wordTokens(text).map((token) => token.normalized));
|
|
7
6
|
}
|
|
@@ -9,28 +8,25 @@ function configuredTerms(options) {
|
|
|
9
8
|
return (options.terms?.map(normalizeForMatch).filter((term) => term.length > 0) ??
|
|
10
9
|
[]);
|
|
11
10
|
}
|
|
12
|
-
const rule = (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (requiredTerms.length === 0) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const terms = presentTerms(documentText(node));
|
|
21
|
-
for (const term of requiredTerms) {
|
|
22
|
-
if (terms.has(term)) {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
emitTextlintFinding(context, {
|
|
26
|
-
node: node,
|
|
27
|
-
ruleId: "term-policy:required-terms",
|
|
28
|
-
message: `Required term missing: "${term}". Add the term or update the policy.`,
|
|
29
|
-
range: { start: 0, end: 0 }
|
|
30
|
-
});
|
|
31
|
-
}
|
|
11
|
+
const rule = oneToOneRule({
|
|
12
|
+
detect: (unit, options) => {
|
|
13
|
+
const requiredTerms = configuredTerms(options);
|
|
14
|
+
if (requiredTerms.length === 0) {
|
|
15
|
+
return [];
|
|
32
16
|
}
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
const terms = presentTerms(unit.text);
|
|
18
|
+
return requiredTerms
|
|
19
|
+
.filter((term) => !terms.has(term))
|
|
20
|
+
.map((term) => ({
|
|
21
|
+
evidence: term,
|
|
22
|
+
label: term,
|
|
23
|
+
range: { start: 0, end: 0 }
|
|
24
|
+
}));
|
|
25
|
+
},
|
|
26
|
+
family: "term-policy",
|
|
27
|
+
formatMessage: (report) => `Required term missing: "${report.evidence}". Add the term or update the policy.`,
|
|
28
|
+
ruleId: "term-policy:required-terms",
|
|
29
|
+
unitKind: "document"
|
|
30
|
+
});
|
|
35
31
|
export default rule;
|
|
36
32
|
//# sourceMappingURL=required-terms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-terms.js","sourceRoot":"","sources":["../../../src/rules/term-policy/required-terms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"required-terms.js","sourceRoot":"","sources":["../../../src/rules/term-policy/required-terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAMpE,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,eAAe,CACtB,OAAuC;IAEvC,OAAO,CACL,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACvE,EAAE,CACH,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,YAAY,CAAuB;IAC9C,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,aAAa;aACjB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aAClC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACd,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;SAC5B,CAAC,CAAC,CAAC;IACR,CAAC;IACD,MAAM,EAAE,aAAa;IACrB,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,2BAA2B,MAAM,CAAC,QAAQ,uCAAuC;IACnF,MAAM,EAAE,4BAA4B;IACpC,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { allParagraphSentences } from "../../shared/text/sections.js";
|
|
2
1
|
import { wordTokens } from "../../shared/text/tokens.js";
|
|
3
|
-
import {
|
|
2
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
4
3
|
const HEDGE_THRESHOLD = 2;
|
|
5
4
|
const HEDGE_WORDS = new Set([
|
|
6
5
|
"might",
|
|
@@ -21,27 +20,24 @@ function hedgeCount(text) {
|
|
|
21
20
|
}
|
|
22
21
|
return count;
|
|
23
22
|
}
|
|
24
|
-
const rule = (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const count = hedgeCount(item.sentence.text);
|
|
30
|
-
if (count < HEDGE_THRESHOLD) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
emitTextlintFinding(context, {
|
|
34
|
-
node: item.paragraph,
|
|
35
|
-
ruleId: "words:hedge-stacking",
|
|
36
|
-
message: `Hedge stacking found: ${count} hedge words in one sentence. Keep fewer than ${HEDGE_THRESHOLD}.`,
|
|
37
|
-
range: {
|
|
38
|
-
start: item.source.originalStartFor(item.sentence.start),
|
|
39
|
-
end: item.source.originalEndFor(item.sentence.end)
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
23
|
+
const rule = oneToOneRule({
|
|
24
|
+
detect: (unit) => {
|
|
25
|
+
const count = hedgeCount(unit.text);
|
|
26
|
+
if (count < HEDGE_THRESHOLD) {
|
|
27
|
+
return [];
|
|
43
28
|
}
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
evidence: String(count),
|
|
32
|
+
label: "hedge stacking",
|
|
33
|
+
range: { start: 0, end: unit.text.length }
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
},
|
|
37
|
+
family: "words",
|
|
38
|
+
formatMessage: (report) => `Hedge stacking found: ${report.evidence} hedge words in one sentence. Keep fewer than ${HEDGE_THRESHOLD}.`,
|
|
39
|
+
ruleId: "words:hedge-stacking",
|
|
40
|
+
unitKind: "sentence"
|
|
41
|
+
});
|
|
46
42
|
export default rule;
|
|
47
43
|
//# sourceMappingURL=hedge-stacking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hedge-stacking.js","sourceRoot":"","sources":["../../../src/rules/words/hedge-stacking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hedge-stacking.js","sourceRoot":"","sources":["../../../src/rules/words/hedge-stacking.ts"],"names":[],"mappings":"AAAA,OAAO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,5 +1,5 @@
|
|
|
1
1
|
import { wordTokens } from "../../shared/text/tokens.js";
|
|
2
|
-
import {
|
|
2
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
3
3
|
const LLM_VOCABULARY = new Set([
|
|
4
4
|
"delve",
|
|
5
5
|
"vibrant",
|
|
@@ -14,24 +14,18 @@ const LLM_VOCABULARY = new Set([
|
|
|
14
14
|
"moreover",
|
|
15
15
|
"tapestry"
|
|
16
16
|
]);
|
|
17
|
-
const rule = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
range: { start: token.start, end: token.end }
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
17
|
+
const rule = oneToOneRule({
|
|
18
|
+
detect: (unit) => wordTokens(unit.text)
|
|
19
|
+
.filter((token) => LLM_VOCABULARY.has(token.normalized))
|
|
20
|
+
.map((token) => ({
|
|
21
|
+
evidence: token.text,
|
|
22
|
+
label: token.text,
|
|
23
|
+
range: { start: token.start, end: token.end }
|
|
24
|
+
})),
|
|
25
|
+
family: "words",
|
|
26
|
+
formatMessage: (report) => `LLM vocabulary found: "${report.evidence}". Replace the stock diction with a concrete word.`,
|
|
27
|
+
ruleId: "words:llm-vocabulary",
|
|
28
|
+
unitKind: "str"
|
|
29
|
+
});
|
|
36
30
|
export default rule;
|
|
37
31
|
//# sourceMappingURL=llm-vocabulary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-vocabulary.js","sourceRoot":"","sources":["../../../src/rules/words/llm-vocabulary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"llm-vocabulary.js","sourceRoot":"","sources":["../../../src/rules/words/llm-vocabulary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,OAAO;IACP,SAAS;IACT,WAAW;IACX,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,eAAe;IACf,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,YAAY,CAAC;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;SAClB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SACvD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,QAAQ,EAAE,KAAK,CAAC,IAAI;QACpB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;KAC9C,CAAC,CAAC;IACP,MAAM,EAAE,OAAO;IACf,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,0BAA0B,MAAM,CAAC,QAAQ,oDAAoD;IAC/F,MAAM,EAAE,sBAAsB;IAC9B,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import prohibitedWords from "./data/prohibited-words.json" with { type: "json" };
|
|
2
2
|
import { findPhraseMatches } from "../../shared/matchers/phrases.js";
|
|
3
|
-
import {
|
|
4
|
-
const rule = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
};
|
|
3
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
4
|
+
const rule = oneToOneRule({
|
|
5
|
+
detect: (unit) => findPhraseMatches(unit.text, prohibitedWords).map((match) => ({
|
|
6
|
+
evidence: match.text,
|
|
7
|
+
label: match.text,
|
|
8
|
+
range: { start: match.start, end: match.end }
|
|
9
|
+
})),
|
|
10
|
+
family: "words",
|
|
11
|
+
formatMessage: (report) => `Prohibited word found: "${report.evidence}". Rewrite without this term.`,
|
|
12
|
+
ruleId: "words:prohibited-words",
|
|
13
|
+
unitKind: "str"
|
|
14
|
+
});
|
|
20
15
|
export default rule;
|
|
21
16
|
//# sourceMappingURL=prohibited-words.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prohibited-words.js","sourceRoot":"","sources":["../../../src/rules/words/prohibited-words.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prohibited-words.js","sourceRoot":"","sources":["../../../src/rules/words/prohibited-words.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,MAAM,IAAI,GAAG,YAAY,CAAC;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5D,QAAQ,EAAE,KAAK,CAAC,IAAI;QACpB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;KAC9C,CAAC,CAAC;IACL,MAAM,EAAE,OAAO;IACf,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,2BAA2B,MAAM,CAAC,QAAQ,+BAA+B;IAC3E,MAAM,EAAE,wBAAwB;IAChC,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import simplicityPairs from "./data/simplicity-pairs.json" with { type: "json" };
|
|
2
|
-
import { allParagraphSentences } from "../../shared/text/sections.js";
|
|
3
2
|
import { wordTokens } from "../../shared/text/tokens.js";
|
|
4
|
-
import {
|
|
3
|
+
import { oneToOneRule } from "../private/textlint-rule-builders.js";
|
|
5
4
|
const SIMPLE_BY_COMPLEX = new Map(simplicityPairs.map(([complex, simple]) => [complex, simple]));
|
|
6
|
-
const rule = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (const token of wordTokens(item.sentence.text)) {
|
|
12
|
-
const simple = SIMPLE_BY_COMPLEX.get(token.normalized);
|
|
13
|
-
if (simple === undefined) {
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
emitTextlintFinding(context, {
|
|
17
|
-
node: item.paragraph,
|
|
18
|
-
ruleId: "words:simplicity",
|
|
19
|
-
message: `Complex word found: "${token.text}". Use "${simple}" instead.`,
|
|
20
|
-
range: {
|
|
21
|
-
start: item.source.originalStartFor(item.sentence.start + token.start),
|
|
22
|
-
end: item.source.originalEndFor(item.sentence.start + token.end)
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
5
|
+
const rule = oneToOneRule({
|
|
6
|
+
detect: (unit) => wordTokens(unit.text).flatMap((token) => {
|
|
7
|
+
const simple = SIMPLE_BY_COMPLEX.get(token.normalized);
|
|
8
|
+
if (simple === undefined) {
|
|
9
|
+
return [];
|
|
27
10
|
}
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
data: { simple },
|
|
14
|
+
evidence: token.text,
|
|
15
|
+
label: token.text,
|
|
16
|
+
range: { start: token.start, end: token.end }
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
}),
|
|
20
|
+
family: "words",
|
|
21
|
+
formatMessage: (report) => `Complex word found: "${report.evidence}". Use "${report.detections[0]?.data?.["simple"]}" instead.`,
|
|
22
|
+
ruleId: "words:simplicity",
|
|
23
|
+
unitKind: "sentence"
|
|
24
|
+
});
|
|
30
25
|
export default rule;
|
|
31
26
|
//# sourceMappingURL=simplicity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplicity.js","sourceRoot":"","sources":["../../../src/rules/words/simplicity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simplicity.js","sourceRoot":"","sources":["../../../src/rules/words/simplicity.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAC9D,CAAC;AAEF,MAAM,IAAI,GAAG,YAAY,CAAC;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL;gBACE,IAAI,EAAE,EAAE,MAAM,EAAE;gBAChB,QAAQ,EAAE,KAAK,CAAC,IAAI;gBACpB,KAAK,EAAE,KAAK,CAAC,IAAI;gBACjB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;aAC9C;SACF,CAAC;IACJ,CAAC,CAAC;IACJ,MAAM,EAAE,OAAO;IACf,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,wBAAwB,MAAM,CAAC,QAAQ,WAAW,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,YAAY;IACtG,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slopless",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Deterministic textlint rules for detecting slop in prose.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
"lint:css": "stylelint --max-warnings 0 \"styles/**/*.css\"",
|
|
25
25
|
"spellcheck": "cspell .",
|
|
26
26
|
"typecov": "type-coverage --at-least 100",
|
|
27
|
-
"validate": "npm run build && npm run lint && npm run lint:css && npm run format:check && npm run spellcheck && npm run typecov && g3ts
|
|
27
|
+
"validate": "npm run build && npm run lint && npm run lint:css && npm run format:check && npm run spellcheck && npm run typecov && scripts/validate-g3ts.sh"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
31
|
"README.md",
|
|
32
|
+
"skills",
|
|
32
33
|
"slopless.textlintrc.json"
|
|
33
34
|
],
|
|
34
35
|
"bin": {
|
|
@@ -47,10 +48,12 @@
|
|
|
47
48
|
"./rules/narrative-slop/flat-action-cadence": "./dist/rules/narrative-slop/flat-action-cadence.js",
|
|
48
49
|
"./rules/narrative-slop/narrative-cliches": "./dist/rules/narrative-slop/narrative-cliches.js",
|
|
49
50
|
"./rules/narrative-slop/perception-verb-density": "./dist/rules/narrative-slop/perception-verb-density.js",
|
|
51
|
+
"./rules/orthography/artifact-placeholders": "./dist/rules/orthography/artifact-placeholders.js",
|
|
50
52
|
"./rules/orthography/colon-dramatic": "./dist/rules/orthography/colon-dramatic.js",
|
|
51
53
|
"./rules/orthography/em-dashes": "./dist/rules/orthography/em-dashes.js",
|
|
52
54
|
"./rules/orthography/exclamation-density": "./dist/rules/orthography/exclamation-density.js",
|
|
53
55
|
"./rules/orthography/fake-timestamps": "./dist/rules/orthography/fake-timestamps.js",
|
|
56
|
+
"./rules/orthography/hidden-unicode-controls": "./dist/rules/orthography/hidden-unicode-controls.js",
|
|
54
57
|
"./rules/orthography/sentence-case": "./dist/rules/orthography/sentence-case.js",
|
|
55
58
|
"./rules/orthography/smart-quotes": "./dist/rules/orthography/smart-quotes.js",
|
|
56
59
|
"./rules/phrases/cliches": "./dist/rules/phrases/cliches.js",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slopless
|
|
3
|
+
description: Use Slopless to review English Markdown for deterministic AI and human slop signals, including vague phrasing, formulaic prose, weak rhythm, filler, cliches, and readability issues.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Slopless
|
|
7
|
+
|
|
8
|
+
Use this skill when asked to review English Markdown prose for AI slop, human slop, weak phrasing, cliches, filler, formulaic prose, or readability problems.
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
|
|
12
|
+
- Slopless is English-only.
|
|
13
|
+
- Slopless emits JSON only.
|
|
14
|
+
- Slopless reports findings. It does not rewrite prose.
|
|
15
|
+
- Do not use Slopless as a fact checker.
|
|
16
|
+
|
|
17
|
+
## Required Workflow
|
|
18
|
+
|
|
19
|
+
1. Run `npx slopless --help` before the first Slopless run in the session.
|
|
20
|
+
2. Create `.slopless/findings` in the current working directory.
|
|
21
|
+
3. Run Slopless on the requested Markdown files, folders, globs, or stdin.
|
|
22
|
+
4. Save raw JSON output under `.slopless/findings/`.
|
|
23
|
+
5. Use a timestamped filename that identifies the input.
|
|
24
|
+
6. If the user asks for explanation, summarize the saved JSON findings for the user.
|
|
25
|
+
7. Do not leave the only useful result in a temp directory.
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
mkdir -p .slopless/findings
|
|
31
|
+
npx slopless "docs/**/*.md" > ".slopless/findings/$(date +%Y-%m-%d-%H%M%S)--docs-review.json"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
mkdir -p .slopless/findings
|
|
36
|
+
npx slopless draft.md > ".slopless/findings/$(date +%Y-%m-%d-%H%M%S)--draft.json"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mkdir -p .slopless/findings
|
|
41
|
+
npx slopless --stdin --stdin-filename draft.md > ".slopless/findings/$(date +%Y-%m-%d-%H%M%S)--stdin-draft.json"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Output Handling
|
|
45
|
+
|
|
46
|
+
- Exit `0`: no findings.
|
|
47
|
+
- Exit `1`: findings were reported.
|
|
48
|
+
- Exit `2`: command failed before linting.
|
|
49
|
+
- Treat exit `1` as successful execution with prose findings.
|
|
50
|
+
- Read the JSON before explaining results.
|
|
51
|
+
- Preserve rule IDs, file paths, line numbers, and excerpts when summarizing.
|
|
52
|
+
|
|
53
|
+
## Ignore Rules
|
|
54
|
+
|
|
55
|
+
Use textlint comments when a finding is intentionally ignored:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
<!-- textlint-disable slopless/semantic-thinness -->
|
|
59
|
+
|
|
60
|
+
Something shifted in the room.
|
|
61
|
+
|
|
62
|
+
<!-- textlint-enable slopless/semantic-thinness -->
|
|
63
|
+
```
|