From 79839d6355276daa35c797cb0618c2ba9e731624 Mon Sep 17 00:00:00 2001 From: SoonIter Date: Mon, 24 Jun 2024 11:56:21 +0800 Subject: [PATCH] chore(infra): add cspell --- cspell.config.cjs | 30 +++++++++++ package.json | 11 +++- pnpm-lock.yaml | 8 +++ scripts/dictionary.txt | 119 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 cspell.config.cjs create mode 100644 scripts/dictionary.txt diff --git a/cspell.config.cjs b/cspell.config.cjs new file mode 100644 index 000000000..f7e434766 --- /dev/null +++ b/cspell.config.cjs @@ -0,0 +1,30 @@ +const { banWords } = require('cspell-ban-words'); + +module.exports = { + version: '0.2', + language: 'en', + files: ['**/*.{ts,tsx,js,jsx,md,mdx}'], + enableFiletypes: ['mdx'], + ignoreRegExpList: [ + // ignore markdown anchors such as [modifyRsbuildConfig](#modifyrsbuildconfig) + '#.*?\\)', + ], + ignorePaths: [ + 'dist', + 'dist-*', + 'compiled', + 'coverage', + 'doc_build', + 'node_modules', + 'pnpm-lock.yaml', + ], + flagWords: banWords, + dictionaries: ['dictionary'], + dictionaryDefinitions: [ + { + name: 'dictionary', + path: './scripts/dictionary.txt', + addWords: true, + }, + ], +}; diff --git a/package.json b/package.json index b3e188af9..0f61fc72c 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,18 @@ { "name": "rslib-monorepo", "private": true, + "workspaces": { + "packages": [ + "packages/*", + "packages/compat/*", + "scripts/*" + ] + }, "scripts": { "build": "cross-env NX_DAEMON=false nx run-many -t build --parallel=10", "check-dependency-version": "check-dependency-version-consistency .", - "lint": "biome check . --diagnostic-level=warn", + "check-spell": "npx cspell", + "lint": "biome check . --diagnostic-level=warn && pnpm run check-spell", "prebundle": "nx run-many -t prebundle", "prepare": "pnpm run build && simple-git-hooks", "sort-package-json": "npx sort-package-json \"packages/*/package.json\"", @@ -28,6 +36,7 @@ "@modern-js/module-tools": "^2.48.6", "check-dependency-version-consistency": "^4.1.0", "cross-env": "^7.0.3", + "cspell-ban-words": "^0.0.3", "nano-staged": "^0.8.0", "nx": "^19.3.0", "prettier": "^3.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 924e3217b..d45acc450 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: cross-env: specifier: ^7.0.3 version: 7.0.3 + cspell-ban-words: + specifier: ^0.0.3 + version: 0.0.3 nano-staged: specifier: ^0.8.0 version: 0.8.0 @@ -1530,6 +1533,9 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + cspell-ban-words@0.0.3: + resolution: {integrity: sha512-Q7ZO16DFWEP8Vv5CJ63LG95/FomTuxB6WvKhvGUDE3L2hiYl7n2fH+0qoSXL5C3zH6NRPQT4rDS66t1Pi/fILA==} + cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -4546,6 +4552,8 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + cspell-ban-words@0.0.3: {} + cssesc@3.0.0: {} csv-generate@3.4.3: {} diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt new file mode 100644 index 000000000..6a9d9706b --- /dev/null +++ b/scripts/dictionary.txt @@ -0,0 +1,119 @@ +# Custom Dictionary Words +antd +apng +applescript +atrules +biomejs +brotli +browserslistrc +bundleless +caniuse +chunkhash +Chunktmp +classname +codegen +codesandbox +compat +consolas +contentful +corejs +corepack +craco +crossorigin +datauri +deepmerge +docgen +envinfo +estree +facti +filenaming +flac +flexbox +flexbugs +fnames +frontends +fullhash +gzipped +icss +idents +iife +imagex +jfif +jiti +jscpuprofile +jsesc +koppers +lightningcss +liyincode +longpaths +manypkg +mattcompiles +menlo +microfrontend +microfrontends +modularly +napi +nolyfill +ntqry +onclosetag +onopentag +ontext +osascript +outro +pageerror +pathinfo +pcss +perfetto +picocolors +pjpeg +pluggable +pmmmwh +postcssrc +preact +prebundle +preflights +prefresh +preprocessors +pxtorem +rebranded +rolldown +rsbuild +rsdoctor +rsfamily +rslib +rslog +rspack +rspress +selfsign +selfsigned +sirv +sokra +speedscope +srcset +stacktracey +styl +stylex +subdir +subpage +subresource +subresources +svgr +swcrc +systemjs +tailwindcss +taze +templating +transpiling +treeshaking +tsbuildinfo +tsdoc +unocss +unpatch +unplugin +unshift +upath +vitest +vnode +watchpack +webm +webp