Skip to content

Commit f6580c9

Browse files
chore: add linting and spellcheck scripts to package.json (#154)
* chore: add linting and spellcheck scripts to package.json - Added markdownlint for linting markdown files with commands for linting and fixing. - Introduced cspell for spellchecking markdown files. - Created a verify script to run both spellcheck and markdown linting. - Updated dependencies to include markdownlint-cli and cspell. * Resolve lint issues in mdx files * chore(*): fix lint and cspell --------- Co-authored-by: Stamen Stoychev <SStoychev@infragistics.com>
1 parent 1ad5e25 commit f6580c9

658 files changed

Lines changed: 7299 additions & 5537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Lint
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches: [master, vnext]
9+
paths:
10+
- 'docs/**/*.mdx'
11+
- 'docs/**/*.md'
12+
- '.markdownlint.json'
13+
- 'cspell.json'
14+
15+
jobs:
16+
markdown-lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: 'npm'
27+
28+
- run: npm ci
29+
30+
- name: Get changed markdown files
31+
id: changed
32+
run: |
33+
FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- 'docs/**/*.mdx' 'docs/**/*.md' | tr '\n' ' ')
34+
echo "files=$FILES" >> "$GITHUB_OUTPUT"
35+
echo "Found changed files: $FILES"
36+
37+
- name: Markdownlint (changed files)
38+
if: steps.changed.outputs.files != ''
39+
run: npx markdownlint ${{ steps.changed.outputs.files }}
40+
41+
- name: Summary
42+
if: always() && steps.changed.outputs.files != ''
43+
run: |
44+
echo "## Markdownlint Results" >> "$GITHUB_STEP_SUMMARY"
45+
RESULT=$(npx markdownlint ${{ steps.changed.outputs.files }} 2>&1 || true)
46+
ERRORS=$(echo "$RESULT" | grep -c "MD[0-9]" || echo "0")
47+
FILES_WITH_ERRORS=$(echo "$RESULT" | grep "MD[0-9]" | cut -d: -f1 | sort -u | wc -l || echo "0")
48+
echo "**$ERRORS errors** in **$FILES_WITH_ERRORS files**" >> "$GITHUB_STEP_SUMMARY"
49+
if [ "$ERRORS" -gt 0 ]; then
50+
echo '```' >> "$GITHUB_STEP_SUMMARY"
51+
echo "$RESULT" >> "$GITHUB_STEP_SUMMARY"
52+
echo '```' >> "$GITHUB_STEP_SUMMARY"
53+
fi
54+
55+
spellcheck:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 0
61+
62+
- uses: actions/setup-node@v4
63+
with:
64+
node-version: 22
65+
cache: 'npm'
66+
67+
- run: npm ci
68+
69+
- name: Get changed markdown files
70+
id: changed
71+
run: |
72+
FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- 'docs/**/*.mdx' 'docs/**/*.md' | tr '\n' ' ')
73+
echo "files=$FILES" >> "$GITHUB_OUTPUT"
74+
75+
- name: CSpell (changed files)
76+
if: steps.changed.outputs.files != ''
77+
run: npx cspell --no-progress ${{ steps.changed.outputs.files }}
78+
79+
- name: Summary
80+
if: always() && steps.changed.outputs.files != ''
81+
run: |
82+
echo "## CSpell Results" >> "$GITHUB_STEP_SUMMARY"
83+
RESULT=$(npx cspell --no-progress ${{ steps.changed.outputs.files }} 2>&1 || true)
84+
ERRORS=$(echo "$RESULT" | grep -c "Unknown word" || echo "0")
85+
FILES_WITH_ERRORS=$(echo "$RESULT" | grep "Unknown word" | cut -d: -f1 | sort -u | wc -l || echo "0")
86+
echo "**$ERRORS errors** in **$FILES_WITH_ERRORS files**" >> "$GITHUB_STEP_SUMMARY"
87+
if [ "$ERRORS" -gt 0 ]; then
88+
echo '```' >> "$GITHUB_STEP_SUMMARY"
89+
echo "$RESULT" >> "$GITHUB_STEP_SUMMARY"
90+
echo '```' >> "$GITHUB_STEP_SUMMARY"
91+
fi

.markdownlint.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"default": true,
3+
"MD001": false,
4+
"MD003": false,
5+
"MD004": { "style": "dash" },
6+
"MD007": { "indent": 2 },
7+
"MD009": { "br_spaces": 2 },
8+
"MD010": true,
9+
"MD012": { "maximum": 4 },
10+
"MD013": false,
11+
"MD014": true,
12+
"MD018": true,
13+
"MD019": true,
14+
"MD022": false,
15+
"MD023": true,
16+
"MD024": false,
17+
"MD025": false,
18+
"MD026": { "punctuation": ".,;:" },
19+
"MD027": true,
20+
"MD028": false,
21+
"MD029": { "style": "ordered" },
22+
"MD030": true,
23+
"MD031": true,
24+
"MD032": false,
25+
"MD033": false,
26+
"MD034": false,
27+
"MD035": { "style": "---" },
28+
"MD036": false,
29+
"MD037": true,
30+
"MD038": true,
31+
"MD039": true,
32+
"MD040": false,
33+
"MD041": false,
34+
"MD042": true,
35+
"MD043": false,
36+
"MD044": false,
37+
"MD045": false,
38+
"MD046": false,
39+
"MD047": false,
40+
"MD048": { "style": "backtick" },
41+
"MD049": false,
42+
"MD050": { "style": "asterisk" },
43+
"MD051": false,
44+
"MD052": false,
45+
"MD055": false,
46+
"MD056": false,
47+
"MD058": true,
48+
"MD059": false,
49+
"MD060": false
50+
}

.markdownlintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.astro/
4+
generated/

0 commit comments

Comments
 (0)