Skip to content

Commit ea944ca

Browse files
authored
chore: add recheck.yaml file for linting (#211)
1 parent efc2303 commit ea944ca

File tree

2 files changed

+270
-1
lines changed

2 files changed

+270
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"scripts": {
77
"start": "npx @redocly/cli preview",
88
"lint:markdown": "markdownlint-cli2 '**/*.md'",
9-
"lint:markdown:fix": "markdownlint-cli2 '**/*.md' --fix"
9+
"lint:markdown:fix": "markdownlint-cli2 '**/*.md' --fix",
10+
"recheck": "npx @redocly/recheck run --stats",
11+
"recheck:fix": "npx @redocly/recheck run --stats --fix"
1012
},
1113
"author": "team@redocly.com",
1214
"license": "UNLICENSED",

recheck.yaml

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
recheck/us-spelling:
2+
scope: all # default
3+
severity: error
4+
message: 'Use the US spelling "%s" instead of British "%s".'
5+
link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words
6+
assertions:
7+
swap:
8+
ignoreCase: true
9+
wordBoundary: true
10+
pairs:
11+
aeon: eon
12+
aeroplane: airplane
13+
ageing: aging
14+
aluminium: aluminum
15+
anaemia: anemia
16+
anaesthesia: anesthesia
17+
analyse: analyze
18+
annexe: annex
19+
apologise: apologize
20+
behaviour: behavior
21+
busses: buses
22+
calibre: caliber
23+
cancelled: canceled
24+
cancellation: cancelation
25+
catalogue: catalog
26+
categorise: categorize
27+
categorised: categorized
28+
categorises: categorizes
29+
categorising: categorizing
30+
centre: center
31+
cheque: check
32+
civilisation: civilization
33+
civilise: civilize
34+
colour: color
35+
cosy: cozy
36+
cypher: cipher
37+
dependant: dependent
38+
defence: defense
39+
distil: distill
40+
draught: draft
41+
encyclopaedia: encyclopedia
42+
enquiry: inquiry
43+
enrol: enroll
44+
enrolment: enrollment
45+
enthral: enthrall
46+
expiry: expiration
47+
favourite: favorite
48+
fibre: fiber
49+
fillet: filet
50+
flavour: flavor
51+
furore: furor
52+
fulfil: fulfill
53+
gaol: jail
54+
grey: gray
55+
humour: humor
56+
honour: honor
57+
initialled: initialed
58+
initialling: initialing
59+
instil: instill
60+
jewellery: jewelry
61+
labelling: labeling
62+
labelled: labeled
63+
labour: labor
64+
libellous: libelous
65+
licence: license
66+
likeable: likable
67+
liveable: livable
68+
lustre: luster
69+
manoeuvre: maneuver
70+
marvellous: marvelous
71+
matt: matte
72+
meagre: meager
73+
metre: meter
74+
modelling: modeling
75+
moustache: mustache
76+
neighbour: neighbor
77+
normalise: normalize
78+
offence: offense
79+
organise: organize
80+
organisation: organization
81+
orientated: oriented
82+
paralyse: paralyze
83+
plough: plow
84+
pretence: pretense
85+
programme: program
86+
pyjamas: pajamas
87+
rateable: ratable
88+
realise: realize
89+
recognise: recognize
90+
reconnoitre: reconnoiter
91+
rumour: rumor
92+
sabre: saber
93+
saleable: salable
94+
saltpetre: saltpeter
95+
sceptic: skeptic
96+
sepulchre: sepulcher
97+
signalling: signaling
98+
sizeable: sizable
99+
skilful: skillful
100+
sombre: somber
101+
smoulder: smolder
102+
speciality: specialty
103+
spectre: specter
104+
splendour: splendor
105+
standardise: standardize
106+
standardised: standardized
107+
sulphur: sulfur
108+
theatre: theater
109+
travelled: traveled
110+
traveller: traveler
111+
travelling: traveling
112+
unshakeable: unshakable
113+
wilful: willful
114+
yoghurt: yogurt
115+
116+
exceptions:
117+
files:
118+
- docs/public/branding/**
119+
- docs/redoc-ce/@v3.x/deployment/html.md
120+
- docs/public/customization/react-components/list/tag.md
121+
# lines:
122+
# - "test this functionality"
123+
124+
recheck/inclusion-gender-culture:
125+
severity: error
126+
message: 'Use inclusive language. Consider "%s" instead of "%s".'
127+
assertions:
128+
swap:
129+
he: they
130+
his: their
131+
she: they
132+
hers: their
133+
blacklist(?:ed|ing|s)?: blocklist
134+
whitelist(?:ed|ing|s)?: allowlist
135+
master: primary, main
136+
slave: replica
137+
he/she: they
138+
s/he: they
139+
140+
recheck/no-gerund-headings:
141+
severity: error
142+
scope: heading
143+
message: 'Do not start headings with a gerund.'
144+
assertions:
145+
pattern:
146+
ignoreCase: true
147+
tokens:
148+
- "^#+ \\w*ing\\b"
149+
exceptions:
150+
lines:
151+
- According
152+
- Betting
153+
- Billing
154+
- Branding
155+
- Breaking
156+
- Dogfooding
157+
- Engineering
158+
- Hiring
159+
- Hosting
160+
- Landing
161+
- Marketing
162+
- Monitoring
163+
- Naming
164+
- Onboarding
165+
- Packaging
166+
- Pricing
167+
- Reasoning
168+
- Recruiting
169+
- Reporting
170+
- Settings
171+
- Training
172+
- Troubleshooting
173+
- Testing
174+
- Writing
175+
- hideLoading
176+
- Routing
177+
- Naming
178+
# files:
179+
# - todo
180+
181+
recheck/oxford-comma:
182+
severity: error
183+
scope: sentence
184+
message: "Use the Oxford comma in '%s'."
185+
assertions:
186+
pattern:
187+
tokens:
188+
- '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]'
189+
190+
recheck/readable-line-length:
191+
severity: warn
192+
message: 'Keep lines under %s characters.'
193+
assertions:
194+
max-line-length:
195+
maxLength: 400
196+
ignoreCodeBlocks: true
197+
ignoreTables: true
198+
ignoreHtmlTags: true
199+
ignoreMarkdownLinkUrls: true
200+
201+
recheck/no-trailing-spaces:
202+
severity: error
203+
message: 'Remove trailing spaces.'
204+
autoFixable: true
205+
assertions:
206+
no-trailing-spaces:
207+
skipCodeBlocks: true
208+
skipBlankLines: false
209+
210+
recheck/bullet-style-dash:
211+
severity: error
212+
message: "Use '-' for unordered list bullets."
213+
autoFixable: true
214+
assertions:
215+
bullet-style:
216+
style: '-'
217+
normalizeNested: true
218+
219+
recheck/semantic-line-breaks:
220+
severity: error
221+
message: 'Use semantic line breaks (%s mode).'
222+
autoFixable: true # Thoroughly tested
223+
assertions:
224+
semantic-line-breaks:
225+
mode: sentence
226+
ignoreCodeBlocks: true
227+
ignoreTables: true
228+
229+
recheck/no-hard-tabs:
230+
severity: error
231+
message: 'Use spaces instead of tabs.'
232+
autoFixable: true
233+
assertions:
234+
no-hard-tabs:
235+
skipCodeBlocks: true
236+
spacesPerTab: 2
237+
238+
recheck/no-duplicate-headings:
239+
severity: warn
240+
message: 'Duplicate heading "%s" (first used on line %d).'
241+
assertions:
242+
no-duplicate-headings:
243+
caseSensitive: false
244+
ignoreCommonHeadings: false
245+
respectSections: true # Default: don't flag duplicates in different sections
246+
247+
recheck/no-broken-fragment-links:
248+
severity: error
249+
message: 'Broken link fragment: %s'
250+
assertions:
251+
no-broken-fragment-links:
252+
checkExternalFiles: true
253+
exceptions:
254+
lines:
255+
- '#stage-3.-offer'
256+
- '#3.-hr-interview'
257+
- '#input/output-types'
258+
files:
259+
- '**/_partials/**'
260+
261+
recheck/optimize-images:
262+
severity: error
263+
message: 'Image too large: %s'
264+
assertions:
265+
max-image-size:
266+
maxSizeKB: 100
267+
extensions: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg']

0 commit comments

Comments
 (0)