Skip to content

Commit cbbe1a6

Browse files
committed
chore: setup cspell
1 parent b32231b commit cbbe1a6

6 files changed

Lines changed: 57 additions & 1 deletion

File tree

‎.github/workflows/lint.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ jobs:
3535
run_install: true
3636

3737
- name: Run Lint
38-
run: pnpm run lint
38+
run: node --run lint
39+
40+
- name: Check Spell
41+
run: node --run check-spell

‎cspell.config.js‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { banWords } from 'cspell-ban-words';
2+
3+
export default {
4+
version: '0.2',
5+
language: 'en',
6+
files: ['**/*.{ts,tsx,js,jsx,md,mdx}'],
7+
enableFiletypes: ['mdx'],
8+
ignoreRegExpList: [
9+
// ignore markdown anchors such as [modifyRsbuildConfig](#modifyrsbuildconfig)
10+
'#.*?\\)',
11+
// ignore custom anchor declarations such as ## createRsbuild \{#creatersbuild}
12+
'\\\\\\{#[^}]+\\}',
13+
// ignore release note author mentions such as "by @chenjiahan"
14+
'by\\s+@[A-Za-z0-9_-]+',
15+
],
16+
ignorePaths: [
17+
'dist',
18+
'dist-*',
19+
'coverage',
20+
'doc_build',
21+
'node_modules',
22+
'pnpm-lock.yaml',
23+
],
24+
flagWords: banWords,
25+
dictionaries: ['dictionary'],
26+
dictionaryDefinitions: [
27+
{
28+
name: 'dictionary',
29+
path: './scripts/dictionary.txt',
30+
addWords: true,
31+
},
32+
],
33+
};

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"scripts": {
2626
"build": "rslib",
27+
"check-spell": "pnpm dlx cspell",
2728
"dev": "rslib -w",
2829
"format": "oxfmt .",
2930
"format:check": "oxfmt . --check",
@@ -41,6 +42,7 @@
4142
"@rslint/core": "catalog:",
4243
"@types/node": "catalog:",
4344
"cac": "catalog:",
45+
"cspell-ban-words": "catalog:",
4446
"oxfmt": "catalog:",
4547
"playwright": "catalog:",
4648
"typescript": "catalog:"

‎pnpm-lock.yaml‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ catalog:
1515
'@types/react': '^19.2.17'
1616
'@types/react-dom': '^19.2.3'
1717
'cac': '^7.0.0'
18+
'cspell-ban-words': '^0.0.4'
1819
'oxfmt': '^0.56.0'
1920
'playwright': '^1.60.0'
2021
'react': '^19.2.7'

‎scripts/dictionary.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Custom Dictionary Words
2+
rslib
3+
rslint
4+
rsbuild
5+
rspack
6+
rstack

0 commit comments

Comments
 (0)