ai-text-check 1.0.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/LICENSE +21 -0
- package/NOTICE +36 -0
- package/README.md +174 -0
- package/SOURCES.md +34 -0
- package/dist/cli.js +13834 -0
- package/dist/index.cjs +13366 -0
- package/dist/index.d.cts +36 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +13351 -0
- package/dist/node.cjs +13581 -0
- package/dist/node.d.cts +41 -0
- package/dist/node.d.ts +41 -0
- package/dist/node.js +13564 -0
- package/dist/types-BlvvRFG5.d.cts +153 -0
- package/dist/types-BlvvRFG5.d.ts +153 -0
- package/package.json +115 -0
- package/slop-gate.config.json +3 -0
- package/vale/styles/AiTextCheck/DiveDeep.yml +5 -0
- package/vale/styles/AiTextCheck/Furthermore.yml +5 -0
- package/vale/styles/AiTextCheck/ImportantToNote.yml +5 -0
- package/vale/styles/AiTextCheck/InTodaysWorld.yml +5 -0
- package/vale/styles/AiTextCheck/LeverageUtilize.yml +5 -0
- package/vale/styles/AiTextCheck/meta.json +3 -0
- package/vale/styles/Google/AMPM.yml +9 -0
- package/vale/styles/Google/Acronyms.yml +64 -0
- package/vale/styles/Google/Colons.yml +8 -0
- package/vale/styles/Google/Contractions.yml +30 -0
- package/vale/styles/Google/DateFormat.yml +9 -0
- package/vale/styles/Google/Ellipses.yml +9 -0
- package/vale/styles/Google/EmDash.yml +12 -0
- package/vale/styles/Google/Exclamation.yml +12 -0
- package/vale/styles/Google/FirstPerson.yml +13 -0
- package/vale/styles/Google/Gender.yml +9 -0
- package/vale/styles/Google/GenderBias.yml +43 -0
- package/vale/styles/Google/HeadingPunctuation.yml +13 -0
- package/vale/styles/Google/Headings.yml +29 -0
- package/vale/styles/Google/LICENSE +21 -0
- package/vale/styles/Google/Latin.yml +11 -0
- package/vale/styles/Google/LyHyphens.yml +14 -0
- package/vale/styles/Google/OptionalPlurals.yml +12 -0
- package/vale/styles/Google/Ordinal.yml +7 -0
- package/vale/styles/Google/OxfordComma.yml +7 -0
- package/vale/styles/Google/Parens.yml +7 -0
- package/vale/styles/Google/Passive.yml +184 -0
- package/vale/styles/Google/Periods.yml +7 -0
- package/vale/styles/Google/Quotes.yml +7 -0
- package/vale/styles/Google/Ranges.yml +7 -0
- package/vale/styles/Google/Semicolons.yml +8 -0
- package/vale/styles/Google/Slang.yml +11 -0
- package/vale/styles/Google/Spacing.yml +10 -0
- package/vale/styles/Google/Spelling.yml +10 -0
- package/vale/styles/Google/Units.yml +8 -0
- package/vale/styles/Google/We.yml +11 -0
- package/vale/styles/Google/Will.yml +7 -0
- package/vale/styles/Google/WordList.yml +80 -0
- package/vale/styles/Google/meta.json +4 -0
- package/vale/styles/Google/vocab.txt +0 -0
- package/vale/styles/ai-tells/AIAdjectiveNounPairs.yml +8 -0
- package/vale/styles/ai-tells/AICompoundPhrases.yml +139 -0
- package/vale/styles/ai-tells/AbsoluteAssertions.yml +21 -0
- package/vale/styles/ai-tells/AffirmativeFormulas.yml +101 -0
- package/vale/styles/ai-tells/AnnouncementHeadings.yml +16 -0
- package/vale/styles/ai-tells/AnthropomorphicJustification.yml +115 -0
- package/vale/styles/ai-tells/ClosingPleasantries.yml +120 -0
- package/vale/styles/ai-tells/ColloquialAssessments.yml +47 -0
- package/vale/styles/ai-tells/ColonUsage.yml +18 -0
- package/vale/styles/ai-tells/ConclusionMarkers.yml +23 -0
- package/vale/styles/ai-tells/ContrastiveFormulas.yml +188 -0
- package/vale/styles/ai-tells/ContrastiveNegation.yml +22 -0
- package/vale/styles/ai-tells/DefensiveHedges.yml +63 -0
- package/vale/styles/ai-tells/DespiteChallenges.yml +32 -0
- package/vale/styles/ai-tells/EmDashUsage.yml +9 -0
- package/vale/styles/ai-tells/EmphaticCopula.yml +30 -0
- package/vale/styles/ai-tells/EmptyPadding.yml +10 -0
- package/vale/styles/ai-tells/EmptyPaddingStacked.yml +11 -0
- package/vale/styles/ai-tells/ExplainerHeadings.yml +20 -0
- package/vale/styles/ai-tells/FalseBalance.yml +31 -0
- package/vale/styles/ai-tells/FalseExclusivity.yml +41 -0
- package/vale/styles/ai-tells/FigurativeLands.yml +79 -0
- package/vale/styles/ai-tells/FillerPhrases.yml +78 -0
- package/vale/styles/ai-tells/FormalRegister.yml +58 -0
- package/vale/styles/ai-tells/FormalTransitions.yml +74 -0
- package/vale/styles/ai-tells/GrowthMetaphors.yml +28 -0
- package/vale/styles/ai-tells/HedgingPhrases.yml +85 -0
- package/vale/styles/ai-tells/LICENSE +21 -0
- package/vale/styles/ai-tells/ListIntroductions.yml +22 -0
- package/vale/styles/ai-tells/MarketingHeadings.yml +19 -0
- package/vale/styles/ai-tells/Metacommentary.yml +113 -0
- package/vale/styles/ai-tells/MicDrop.yml +205 -0
- package/vale/styles/ai-tells/MicDropHeadings.yml +20 -0
- package/vale/styles/ai-tells/NarrativePivots.yml +59 -0
- package/vale/styles/ai-tells/OpeningCliches.yml +98 -0
- package/vale/styles/ai-tells/OrganicConsequence.yml +38 -0
- package/vale/styles/ai-tells/OverusedVocabulary.yml +185 -0
- package/vale/styles/ai-tells/OverusedVocabularyVerbs.yml +7 -0
- package/vale/styles/ai-tells/ParallelStaccato.yml +34 -0
- package/vale/styles/ai-tells/ParticipialPadding.yml +74 -0
- package/vale/styles/ai-tells/PromotionalPuffery.yml +63 -0
- package/vale/styles/ai-tells/RedundantPrecaution.yml +8 -0
- package/vale/styles/ai-tells/ResonateOveruse.yml +13 -0
- package/vale/styles/ai-tells/RestatementMarkers.yml +36 -0
- package/vale/styles/ai-tells/RhetoricalDevices.yml +53 -0
- package/vale/styles/ai-tells/RhetoricalSelfAnswer.yml +51 -0
- package/vale/styles/ai-tells/SelfReference.yml +52 -0
- package/vale/styles/ai-tells/SemicolonUsage.yml +31 -0
- package/vale/styles/ai-tells/SequencingMarkers.yml +41 -0
- package/vale/styles/ai-tells/ServesAsDodge.yml +66 -0
- package/vale/styles/ai-tells/ShipOveruse.yml +16 -0
- package/vale/styles/ai-tells/StackedAnaphora.yml +185 -0
- package/vale/styles/ai-tells/StrategyBuzzwords.yml +32 -0
- package/vale/styles/ai-tells/StructureAnnouncements.yml +22 -0
- package/vale/styles/ai-tells/SycophancyMarkers.yml +26 -0
- package/vale/styles/ai-tells/UnpackExplore.yml +21 -0
- package/vale/styles/ai-tells/UrgencyInflation.yml +70 -0
- package/vale/styles/ai-tells/VagueAttributions.yml +67 -0
- package/vale/styles/ai-tells/VerbTricolon.yml +78 -0
- package/vale/styles/ai-tells/VerbTricolonDensity.yml +7 -0
- package/vale/styles/ai-tells/WrapUpHeadings.yml +22 -0
- package/vale/styles/signs-of-ai-writing/AspectOveruse.yml +13 -0
- package/vale/styles/signs-of-ai-writing/ChatGPTArtifacts.yml +12 -0
- package/vale/styles/signs-of-ai-writing/ChatbotCommunication.yml +21 -0
- package/vale/styles/signs-of-ai-writing/CitationArtifacts.yml +10 -0
- package/vale/styles/signs-of-ai-writing/ColonOveruse.yml +11 -0
- package/vale/styles/signs-of-ai-writing/Enumeration.yml +11 -0
- package/vale/styles/signs-of-ai-writing/Hedging.yml +6 -0
- package/vale/styles/signs-of-ai-writing/Intensifiers.yml +17 -0
- package/vale/styles/signs-of-ai-writing/KnowledgeCutoff.yml +14 -0
- package/vale/styles/signs-of-ai-writing/LICENSE +12 -0
- package/vale/styles/signs-of-ai-writing/Lists.yml +8 -0
- package/vale/styles/signs-of-ai-writing/Narrative.yml +15 -0
- package/vale/styles/signs-of-ai-writing/Passive.yml +16 -0
- package/vale/styles/signs-of-ai-writing/Placeholders.yml +17 -0
- package/vale/styles/signs-of-ai-writing/ScareQuotes.yml +6 -0
- package/vale/styles/signs-of-ai-writing/Symbolism.yml +23 -0
- package/vale/styles/signs-of-ai-writing/Transitions.yml +17 -0
- package/vale/styles/signs-of-ai-writing/UTMParameters.yml +10 -0
- package/vale/styles/signs-of-ai-writing/Vocabulary.yml +27 -0
- package/vale/styles/signs-of-ai-writing/meta.json +4 -0
- package/vale/styles/write-good/Cliches.yml +702 -0
- package/vale/styles/write-good/E-Prime.yml +32 -0
- package/vale/styles/write-good/Illusions.yml +11 -0
- package/vale/styles/write-good/LICENSE +21 -0
- package/vale/styles/write-good/Passive.yml +183 -0
- package/vale/styles/write-good/README.md +27 -0
- package/vale/styles/write-good/So.yml +5 -0
- package/vale/styles/write-good/ThereIs.yml +6 -0
- package/vale/styles/write-good/TooWordy.yml +221 -0
- package/vale/styles/write-good/Weasel.yml +29 -0
- package/vale/styles/write-good/meta.json +4 -0
- package/vale/vale.ini +38 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
type Severity = "error" | "warn" | "info";
|
|
2
|
+
type Category = "ai" | "grammar" | "readability" | "structure" | "seo" | "typography";
|
|
3
|
+
type EngineName = "polish" | "slop-gate" | "write-good" | "retext" | "is-this-ai-slop" | "veldica" | "clean-writing" | "vale";
|
|
4
|
+
type TextFormat = "auto" | "plain" | "markdown";
|
|
5
|
+
type PresetName = "default" | "strict" | "ai" | "grammar";
|
|
6
|
+
type CheckName = "ai" | "grammar" | "readability" | "structure" | "seo" | "typography";
|
|
7
|
+
type Issue = {
|
|
8
|
+
rule: string;
|
|
9
|
+
category: Category;
|
|
10
|
+
severity: Severity;
|
|
11
|
+
message: string;
|
|
12
|
+
engine?: EngineName;
|
|
13
|
+
line?: number;
|
|
14
|
+
column?: number;
|
|
15
|
+
excerpt?: string;
|
|
16
|
+
suggestion?: string;
|
|
17
|
+
match?: string;
|
|
18
|
+
};
|
|
19
|
+
type TextStats = {
|
|
20
|
+
words: number;
|
|
21
|
+
sentences: number;
|
|
22
|
+
paragraphs: number;
|
|
23
|
+
avgSentenceLength: number;
|
|
24
|
+
avgParagraphLength: number;
|
|
25
|
+
passiveVoiceHits: number;
|
|
26
|
+
aiPatternHits: number;
|
|
27
|
+
fleschReadingEase: number;
|
|
28
|
+
titleLength: number;
|
|
29
|
+
descriptionLength: number;
|
|
30
|
+
};
|
|
31
|
+
type CheckReport = {
|
|
32
|
+
source: string;
|
|
33
|
+
title: string;
|
|
34
|
+
format: Exclude<TextFormat, "auto">;
|
|
35
|
+
score: number;
|
|
36
|
+
issues: Issue[];
|
|
37
|
+
stats: TextStats;
|
|
38
|
+
enginesRun: EngineName[];
|
|
39
|
+
fixedText?: string;
|
|
40
|
+
};
|
|
41
|
+
type CheckSummary = {
|
|
42
|
+
reports: CheckReport[];
|
|
43
|
+
filesChecked: number;
|
|
44
|
+
filesWithIssues: number;
|
|
45
|
+
filesFixed: number;
|
|
46
|
+
averageScore: number;
|
|
47
|
+
failed: boolean;
|
|
48
|
+
};
|
|
49
|
+
type ChecksConfig = {
|
|
50
|
+
ai?: boolean;
|
|
51
|
+
grammar?: boolean;
|
|
52
|
+
readability?: boolean;
|
|
53
|
+
structure?: boolean;
|
|
54
|
+
seo?: boolean;
|
|
55
|
+
typography?: boolean;
|
|
56
|
+
};
|
|
57
|
+
type EnginesConfig = {
|
|
58
|
+
polish?: boolean;
|
|
59
|
+
slopGate?: boolean;
|
|
60
|
+
writeGood?: boolean;
|
|
61
|
+
retext?: boolean;
|
|
62
|
+
isThisAiSlop?: boolean;
|
|
63
|
+
veldica?: boolean;
|
|
64
|
+
cleanWriting?: boolean;
|
|
65
|
+
vale?: boolean;
|
|
66
|
+
};
|
|
67
|
+
type MarkdownConfig = {
|
|
68
|
+
skipCode?: boolean;
|
|
69
|
+
skipFrontmatter?: boolean;
|
|
70
|
+
skipHtml?: boolean;
|
|
71
|
+
skipTables?: boolean;
|
|
72
|
+
};
|
|
73
|
+
type SeoThresholds = {
|
|
74
|
+
titleMin?: number;
|
|
75
|
+
titleMax?: number;
|
|
76
|
+
descriptionMin?: number;
|
|
77
|
+
descriptionMax?: number;
|
|
78
|
+
};
|
|
79
|
+
type ReadabilityThresholds = {
|
|
80
|
+
avgSentenceWarn?: number;
|
|
81
|
+
longSentenceWords?: number;
|
|
82
|
+
longParagraphWords?: number;
|
|
83
|
+
passiveRatio?: number;
|
|
84
|
+
};
|
|
85
|
+
type UserConfig = {
|
|
86
|
+
preset?: PresetName;
|
|
87
|
+
checks?: ChecksConfig;
|
|
88
|
+
engines?: EnginesConfig;
|
|
89
|
+
format?: TextFormat;
|
|
90
|
+
failOn?: Severity;
|
|
91
|
+
minScore?: number;
|
|
92
|
+
ignoreRules?: string[];
|
|
93
|
+
include?: string[];
|
|
94
|
+
exclude?: string[];
|
|
95
|
+
extensions?: string[];
|
|
96
|
+
markdown?: MarkdownConfig;
|
|
97
|
+
seo?: SeoThresholds;
|
|
98
|
+
readability?: ReadabilityThresholds;
|
|
99
|
+
};
|
|
100
|
+
type ResolvedConfig = {
|
|
101
|
+
preset: PresetName;
|
|
102
|
+
checks: Required<ChecksConfig>;
|
|
103
|
+
engines: Required<EnginesConfig>;
|
|
104
|
+
format: TextFormat;
|
|
105
|
+
failOn: Severity;
|
|
106
|
+
minScore: number;
|
|
107
|
+
ignoreRules: string[];
|
|
108
|
+
include: string[];
|
|
109
|
+
exclude: string[];
|
|
110
|
+
extensions: string[];
|
|
111
|
+
markdown: Required<MarkdownConfig>;
|
|
112
|
+
seo: Required<SeoThresholds>;
|
|
113
|
+
readability: Required<ReadabilityThresholds>;
|
|
114
|
+
};
|
|
115
|
+
type CheckOptions = {
|
|
116
|
+
source?: string;
|
|
117
|
+
format?: TextFormat;
|
|
118
|
+
applyFixes?: boolean;
|
|
119
|
+
config?: UserConfig;
|
|
120
|
+
};
|
|
121
|
+
type SanitizeOptions = {
|
|
122
|
+
dashes?: boolean;
|
|
123
|
+
smartQuotes?: boolean;
|
|
124
|
+
ellipses?: boolean;
|
|
125
|
+
invisibleChars?: boolean;
|
|
126
|
+
spaces?: boolean;
|
|
127
|
+
lineStartBullets?: boolean;
|
|
128
|
+
};
|
|
129
|
+
type ReplacementStats = {
|
|
130
|
+
dashes: number;
|
|
131
|
+
smartQuotes: number;
|
|
132
|
+
ellipses: number;
|
|
133
|
+
invisibleChars: number;
|
|
134
|
+
spaces: number;
|
|
135
|
+
lineStartBullets: number;
|
|
136
|
+
total: number;
|
|
137
|
+
};
|
|
138
|
+
type ClauseReplacer = (substring: string, ...groups: string[]) => string;
|
|
139
|
+
type PatternRule = {
|
|
140
|
+
id: string;
|
|
141
|
+
category: Category;
|
|
142
|
+
pattern: RegExp;
|
|
143
|
+
message: string;
|
|
144
|
+
severity?: Severity;
|
|
145
|
+
suggestion?: string;
|
|
146
|
+
replacement?: string | ClauseReplacer;
|
|
147
|
+
autoFix?: boolean;
|
|
148
|
+
minCount?: number | ((ctx: {
|
|
149
|
+
words: number;
|
|
150
|
+
}) => number);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type { CheckOptions as C, EngineName as E, Issue as I, MarkdownConfig as M, PatternRule as P, ResolvedConfig as R, SanitizeOptions as S, TextFormat as T, UserConfig as U, CheckReport as a, ReplacementStats as b, Severity as c, Category as d, CheckName as e, CheckSummary as f, ChecksConfig as g, EnginesConfig as h, PresetName as i, ReadabilityThresholds as j, SeoThresholds as k, TextStats as l };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
type Severity = "error" | "warn" | "info";
|
|
2
|
+
type Category = "ai" | "grammar" | "readability" | "structure" | "seo" | "typography";
|
|
3
|
+
type EngineName = "polish" | "slop-gate" | "write-good" | "retext" | "is-this-ai-slop" | "veldica" | "clean-writing" | "vale";
|
|
4
|
+
type TextFormat = "auto" | "plain" | "markdown";
|
|
5
|
+
type PresetName = "default" | "strict" | "ai" | "grammar";
|
|
6
|
+
type CheckName = "ai" | "grammar" | "readability" | "structure" | "seo" | "typography";
|
|
7
|
+
type Issue = {
|
|
8
|
+
rule: string;
|
|
9
|
+
category: Category;
|
|
10
|
+
severity: Severity;
|
|
11
|
+
message: string;
|
|
12
|
+
engine?: EngineName;
|
|
13
|
+
line?: number;
|
|
14
|
+
column?: number;
|
|
15
|
+
excerpt?: string;
|
|
16
|
+
suggestion?: string;
|
|
17
|
+
match?: string;
|
|
18
|
+
};
|
|
19
|
+
type TextStats = {
|
|
20
|
+
words: number;
|
|
21
|
+
sentences: number;
|
|
22
|
+
paragraphs: number;
|
|
23
|
+
avgSentenceLength: number;
|
|
24
|
+
avgParagraphLength: number;
|
|
25
|
+
passiveVoiceHits: number;
|
|
26
|
+
aiPatternHits: number;
|
|
27
|
+
fleschReadingEase: number;
|
|
28
|
+
titleLength: number;
|
|
29
|
+
descriptionLength: number;
|
|
30
|
+
};
|
|
31
|
+
type CheckReport = {
|
|
32
|
+
source: string;
|
|
33
|
+
title: string;
|
|
34
|
+
format: Exclude<TextFormat, "auto">;
|
|
35
|
+
score: number;
|
|
36
|
+
issues: Issue[];
|
|
37
|
+
stats: TextStats;
|
|
38
|
+
enginesRun: EngineName[];
|
|
39
|
+
fixedText?: string;
|
|
40
|
+
};
|
|
41
|
+
type CheckSummary = {
|
|
42
|
+
reports: CheckReport[];
|
|
43
|
+
filesChecked: number;
|
|
44
|
+
filesWithIssues: number;
|
|
45
|
+
filesFixed: number;
|
|
46
|
+
averageScore: number;
|
|
47
|
+
failed: boolean;
|
|
48
|
+
};
|
|
49
|
+
type ChecksConfig = {
|
|
50
|
+
ai?: boolean;
|
|
51
|
+
grammar?: boolean;
|
|
52
|
+
readability?: boolean;
|
|
53
|
+
structure?: boolean;
|
|
54
|
+
seo?: boolean;
|
|
55
|
+
typography?: boolean;
|
|
56
|
+
};
|
|
57
|
+
type EnginesConfig = {
|
|
58
|
+
polish?: boolean;
|
|
59
|
+
slopGate?: boolean;
|
|
60
|
+
writeGood?: boolean;
|
|
61
|
+
retext?: boolean;
|
|
62
|
+
isThisAiSlop?: boolean;
|
|
63
|
+
veldica?: boolean;
|
|
64
|
+
cleanWriting?: boolean;
|
|
65
|
+
vale?: boolean;
|
|
66
|
+
};
|
|
67
|
+
type MarkdownConfig = {
|
|
68
|
+
skipCode?: boolean;
|
|
69
|
+
skipFrontmatter?: boolean;
|
|
70
|
+
skipHtml?: boolean;
|
|
71
|
+
skipTables?: boolean;
|
|
72
|
+
};
|
|
73
|
+
type SeoThresholds = {
|
|
74
|
+
titleMin?: number;
|
|
75
|
+
titleMax?: number;
|
|
76
|
+
descriptionMin?: number;
|
|
77
|
+
descriptionMax?: number;
|
|
78
|
+
};
|
|
79
|
+
type ReadabilityThresholds = {
|
|
80
|
+
avgSentenceWarn?: number;
|
|
81
|
+
longSentenceWords?: number;
|
|
82
|
+
longParagraphWords?: number;
|
|
83
|
+
passiveRatio?: number;
|
|
84
|
+
};
|
|
85
|
+
type UserConfig = {
|
|
86
|
+
preset?: PresetName;
|
|
87
|
+
checks?: ChecksConfig;
|
|
88
|
+
engines?: EnginesConfig;
|
|
89
|
+
format?: TextFormat;
|
|
90
|
+
failOn?: Severity;
|
|
91
|
+
minScore?: number;
|
|
92
|
+
ignoreRules?: string[];
|
|
93
|
+
include?: string[];
|
|
94
|
+
exclude?: string[];
|
|
95
|
+
extensions?: string[];
|
|
96
|
+
markdown?: MarkdownConfig;
|
|
97
|
+
seo?: SeoThresholds;
|
|
98
|
+
readability?: ReadabilityThresholds;
|
|
99
|
+
};
|
|
100
|
+
type ResolvedConfig = {
|
|
101
|
+
preset: PresetName;
|
|
102
|
+
checks: Required<ChecksConfig>;
|
|
103
|
+
engines: Required<EnginesConfig>;
|
|
104
|
+
format: TextFormat;
|
|
105
|
+
failOn: Severity;
|
|
106
|
+
minScore: number;
|
|
107
|
+
ignoreRules: string[];
|
|
108
|
+
include: string[];
|
|
109
|
+
exclude: string[];
|
|
110
|
+
extensions: string[];
|
|
111
|
+
markdown: Required<MarkdownConfig>;
|
|
112
|
+
seo: Required<SeoThresholds>;
|
|
113
|
+
readability: Required<ReadabilityThresholds>;
|
|
114
|
+
};
|
|
115
|
+
type CheckOptions = {
|
|
116
|
+
source?: string;
|
|
117
|
+
format?: TextFormat;
|
|
118
|
+
applyFixes?: boolean;
|
|
119
|
+
config?: UserConfig;
|
|
120
|
+
};
|
|
121
|
+
type SanitizeOptions = {
|
|
122
|
+
dashes?: boolean;
|
|
123
|
+
smartQuotes?: boolean;
|
|
124
|
+
ellipses?: boolean;
|
|
125
|
+
invisibleChars?: boolean;
|
|
126
|
+
spaces?: boolean;
|
|
127
|
+
lineStartBullets?: boolean;
|
|
128
|
+
};
|
|
129
|
+
type ReplacementStats = {
|
|
130
|
+
dashes: number;
|
|
131
|
+
smartQuotes: number;
|
|
132
|
+
ellipses: number;
|
|
133
|
+
invisibleChars: number;
|
|
134
|
+
spaces: number;
|
|
135
|
+
lineStartBullets: number;
|
|
136
|
+
total: number;
|
|
137
|
+
};
|
|
138
|
+
type ClauseReplacer = (substring: string, ...groups: string[]) => string;
|
|
139
|
+
type PatternRule = {
|
|
140
|
+
id: string;
|
|
141
|
+
category: Category;
|
|
142
|
+
pattern: RegExp;
|
|
143
|
+
message: string;
|
|
144
|
+
severity?: Severity;
|
|
145
|
+
suggestion?: string;
|
|
146
|
+
replacement?: string | ClauseReplacer;
|
|
147
|
+
autoFix?: boolean;
|
|
148
|
+
minCount?: number | ((ctx: {
|
|
149
|
+
words: number;
|
|
150
|
+
}) => number);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type { CheckOptions as C, EngineName as E, Issue as I, MarkdownConfig as M, PatternRule as P, ResolvedConfig as R, SanitizeOptions as S, TextFormat as T, UserConfig as U, CheckReport as a, ReplacementStats as b, Severity as c, Category as d, CheckName as e, CheckSummary as f, ChecksConfig as g, EnginesConfig as h, PresetName as i, ReadabilityThresholds as j, SeoThresholds as k, TextStats as l };
|
package/package.json
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-text-check",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Detect AI-generated writing tells, grammar issues, and synthetic typography in JavaScript and TypeScript projects.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Pritam Ghosh <contact.meghoshpritam@gmail.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/meghoshpritam/ai-text-check.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/meghoshpritam/ai-text-check/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/meghoshpritam/ai-text-check#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai-detection",
|
|
17
|
+
"ai-writing",
|
|
18
|
+
"grammar",
|
|
19
|
+
"linter",
|
|
20
|
+
"prose",
|
|
21
|
+
"markdown",
|
|
22
|
+
"typescript",
|
|
23
|
+
"javascript",
|
|
24
|
+
"vale",
|
|
25
|
+
"slop-gate",
|
|
26
|
+
"readability",
|
|
27
|
+
"content-quality"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0"
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/index.cjs",
|
|
34
|
+
"module": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/index.d.cts",
|
|
44
|
+
"default": "./dist/index.cjs"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"./node": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/node.d.ts",
|
|
50
|
+
"default": "./dist/node.js"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/node.d.cts",
|
|
54
|
+
"default": "./dist/node.cjs"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"./package.json": "./package.json"
|
|
58
|
+
},
|
|
59
|
+
"bin": {
|
|
60
|
+
"ai-text-check": "./dist/cli.js"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"dist",
|
|
64
|
+
"!dist/**/*.map",
|
|
65
|
+
"vale",
|
|
66
|
+
"README.md",
|
|
67
|
+
"LICENSE",
|
|
68
|
+
"NOTICE",
|
|
69
|
+
"SOURCES.md",
|
|
70
|
+
"slop-gate.config.json"
|
|
71
|
+
],
|
|
72
|
+
"sideEffects": false,
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup && node -e \"require('fs').chmodSync('dist/cli.js', 0o755)\"",
|
|
75
|
+
"clean": "rm -rf dist coverage",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:watch": "vitest",
|
|
78
|
+
"lint": "eslint .",
|
|
79
|
+
"lint:fix": "eslint . --fix",
|
|
80
|
+
"format": "prettier --write .",
|
|
81
|
+
"format:check": "prettier --check .",
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"check": "npm run typecheck && npm run lint && npm run format:check && npm run test",
|
|
84
|
+
"prepublishOnly": "npm run check && npm run build"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@eslint/js": "^9.35.0",
|
|
88
|
+
"@types/node": "^22.18.1",
|
|
89
|
+
"@types/write-good": "^1.0.3",
|
|
90
|
+
"eslint": "^9.35.0",
|
|
91
|
+
"eslint-config-prettier": "^10.1.8",
|
|
92
|
+
"globals": "^16.4.0",
|
|
93
|
+
"prettier": "^3.6.2",
|
|
94
|
+
"tsup": "^8.5.0",
|
|
95
|
+
"typescript": "^5.9.2",
|
|
96
|
+
"typescript-eslint": "^8.43.0",
|
|
97
|
+
"vitest": "^3.2.4"
|
|
98
|
+
},
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"@veldica/prose-linter": "^1.1.3",
|
|
101
|
+
"@vvago/vale": "^3.22.0",
|
|
102
|
+
"clean-writing-lint": "^0.1.0",
|
|
103
|
+
"is-this-ai-slop": "^0.1.0",
|
|
104
|
+
"marked": "^15.0.12",
|
|
105
|
+
"retext-english": "^5.0.0",
|
|
106
|
+
"retext-passive": "^5.0.0",
|
|
107
|
+
"retext-readability": "^8.0.0",
|
|
108
|
+
"retext-repeated-words": "^5.0.0",
|
|
109
|
+
"retext-simplify": "^8.0.0",
|
|
110
|
+
"retext-stringify": "^4.0.0",
|
|
111
|
+
"slop-gate": "^0.5.0",
|
|
112
|
+
"unified": "^11.0.5",
|
|
113
|
+
"write-good": "^1.0.8"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
extends: conditional
|
|
2
|
+
message: "Spell out '%s', if it's unfamiliar to the audience."
|
|
3
|
+
link: "https://developers.google.com/style/abbreviations"
|
|
4
|
+
level: suggestion
|
|
5
|
+
ignorecase: false
|
|
6
|
+
# Ensures that the existence of 'first' implies the existence of 'second'.
|
|
7
|
+
first: '\b([A-Z]{3,5})\b'
|
|
8
|
+
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
|
|
9
|
+
# ... with the exception of these:
|
|
10
|
+
exceptions:
|
|
11
|
+
- API
|
|
12
|
+
- ASP
|
|
13
|
+
- CLI
|
|
14
|
+
- CPU
|
|
15
|
+
- CSS
|
|
16
|
+
- CSV
|
|
17
|
+
- DEBUG
|
|
18
|
+
- DOM
|
|
19
|
+
- DPI
|
|
20
|
+
- FAQ
|
|
21
|
+
- GCC
|
|
22
|
+
- GDB
|
|
23
|
+
- GET
|
|
24
|
+
- GPU
|
|
25
|
+
- GTK
|
|
26
|
+
- GUI
|
|
27
|
+
- HTML
|
|
28
|
+
- HTTP
|
|
29
|
+
- HTTPS
|
|
30
|
+
- IDE
|
|
31
|
+
- JAR
|
|
32
|
+
- JSON
|
|
33
|
+
- JSX
|
|
34
|
+
- LESS
|
|
35
|
+
- LLDB
|
|
36
|
+
- NET
|
|
37
|
+
- NOTE
|
|
38
|
+
- NVDA
|
|
39
|
+
- OSS
|
|
40
|
+
- PATH
|
|
41
|
+
- PDF
|
|
42
|
+
- PHP
|
|
43
|
+
- POST
|
|
44
|
+
- RAM
|
|
45
|
+
- REPL
|
|
46
|
+
- RSA
|
|
47
|
+
- SCM
|
|
48
|
+
- SCSS
|
|
49
|
+
- SDK
|
|
50
|
+
- SQL
|
|
51
|
+
- SSH
|
|
52
|
+
- SSL
|
|
53
|
+
- SVG
|
|
54
|
+
- TBD
|
|
55
|
+
- TCP
|
|
56
|
+
- TODO
|
|
57
|
+
- URI
|
|
58
|
+
- URL
|
|
59
|
+
- USB
|
|
60
|
+
- UTF
|
|
61
|
+
- XML
|
|
62
|
+
- XSS
|
|
63
|
+
- YAML
|
|
64
|
+
- ZIP
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
extends: substitution
|
|
2
|
+
message: "Use '%s' instead of '%s'."
|
|
3
|
+
link: "https://developers.google.com/style/contractions"
|
|
4
|
+
level: suggestion
|
|
5
|
+
ignorecase: true
|
|
6
|
+
action:
|
|
7
|
+
name: replace
|
|
8
|
+
swap:
|
|
9
|
+
are not: aren't
|
|
10
|
+
cannot: can't
|
|
11
|
+
could not: couldn't
|
|
12
|
+
did not: didn't
|
|
13
|
+
do not: don't
|
|
14
|
+
does not: doesn't
|
|
15
|
+
has not: hasn't
|
|
16
|
+
have not: haven't
|
|
17
|
+
how is: how's
|
|
18
|
+
is not: isn't
|
|
19
|
+
it is: it's
|
|
20
|
+
should not: shouldn't
|
|
21
|
+
that is: that's
|
|
22
|
+
they are: they're
|
|
23
|
+
was not: wasn't
|
|
24
|
+
we are: we're
|
|
25
|
+
we have: we've
|
|
26
|
+
were not: weren't
|
|
27
|
+
what is: what's
|
|
28
|
+
when is: when's
|
|
29
|
+
where is: where's
|
|
30
|
+
will not: won't
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
extends: existence
|
|
2
|
+
message: "Use 'July 31, 2016' format, not '%s'."
|
|
3
|
+
link: "https://developers.google.com/style/dates-times"
|
|
4
|
+
ignorecase: true
|
|
5
|
+
level: error
|
|
6
|
+
nonword: true
|
|
7
|
+
tokens:
|
|
8
|
+
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
|
|
9
|
+
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
extends: existence
|
|
2
|
+
message: "Avoid first-person pronouns such as '%s'."
|
|
3
|
+
link: "https://developers.google.com/style/pronouns#personal-pronouns"
|
|
4
|
+
ignorecase: true
|
|
5
|
+
level: warning
|
|
6
|
+
nonword: true
|
|
7
|
+
tokens:
|
|
8
|
+
- (?:^|\s)I\s
|
|
9
|
+
- (?:^|\s)I,\s
|
|
10
|
+
- \bI'm\b
|
|
11
|
+
- \bme\b
|
|
12
|
+
- \bmy\b
|
|
13
|
+
- \bmine\b
|