Skip to content

Commit

Permalink
chore(workflow): integrate cspell-ban-words (#274)
Browse files Browse the repository at this point in the history
Co-authored-by: yifancong <[email protected]>
  • Loading branch information
chenjiahan and easy1090 authored Apr 2, 2024
1 parent 0049b3c commit 03ec7a6
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ body:
placeholder: |
for example:
1. execute `yarn dev`
2. find `xxx` error message in the console
2. find the error message in the console
validations:
required: true
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["biomejs.biome"]
"recommendations": [
"biomejs.biome",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker"
]
}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pnpm run build

## Startup Rsdoctor Client

When you make changes to the code and want to view the `Rsdoctor` analysis report, you can execute `build:analysis` in the `examples/xxx` project to see it:
When you make changes to the code and want to view the `Rsdoctor` analysis report, you can execute `build:analysis` in the `examples/foo` project to see it:

```sh
pnpm run build:analysis
Expand Down Expand Up @@ -203,7 +203,7 @@ The format of PR titles follow Conventional Commits.
An example:

```
feat(plugin-swc): Add `xxx` config
feat(plugin-swc): Add `newOption` config
^ ^ ^
| | |__ Subject
| |_______ Scope
Expand Down
30 changes: 30 additions & 0 deletions cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -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 [fooBar](#foobar)
'#.*?\\)',
],
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,
},
],
};
49 changes: 0 additions & 49 deletions cspell.json

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* @scripts/* @e2e/* --parallel=10",
"bump": "modern bump",
"change": "modern change",
"check-spell": "npx cspell",
"check-changeset": "cd ./scripts/check-changeset && pnpm start",
"check-dependency-version": "check-dependency-version-consistency .",
"dev:doc": "cd document && pnpm run dev",
Expand Down Expand Up @@ -38,10 +39,11 @@
"@biomejs/biome": "1.5.1",
"@modern-js/module-tools": "^2.44.0",
"@modern-js/monorepo-tools": "^2.44.0",
"@scripts/test-helper": "workspace:*",
"@rsdoctor/tsconfig": "workspace:*",
"@scripts/test-helper": "workspace:*",
"check-dependency-version-consistency": "^4.1.0",
"cross-env": "^7.0.3",
"cspell-ban-words": "^0.0.3",
"husky": "^8.0.3",
"nano-staged": "^0.8.0",
"nx": "^17.0.1",
Expand Down
12 changes: 9 additions & 3 deletions packages/components/src/components/Opener/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { VSCode, openVSCode } from './vscode';
interface CodeOpenerProps {
windowId?: number;
/**
* @example /xx/src/pages/home/index.ts + 100 modules
* @example /xx/src/pages/b/index.ts
* @example /foo/src/pages/home/index.ts + 100 modules
* @example /foo/src/pages/b/index.ts
*/
url: string;
/**
Expand Down Expand Up @@ -82,7 +82,13 @@ export const CodeOpener = ({
</Typography.Text>
</Typography.Text>
{process.env.NODE_ENV === 'development' ? (
<VSCode file={file} line={line} column={columnStart} windowId={windowId} style={{ marginLeft: 3 }} />
<VSCode
file={file}
line={line}
column={columnStart}
windowId={windowId}
style={{ marginLeft: 3 }}
/>
) : (
<div style={{ display: 'inline-block' }} />
)}
Expand Down
9 changes: 6 additions & 3 deletions packages/document/docs/en/guide/usage/resolver.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
- The Resolver analysis capability is disabled by default. To enable it, you can add `resolver` to the `features` array as shown in the example below. [features configuration](../../config/options/options).

```js
new rsdoctorWebpackPlugin({
features: ["xxx", "xxx", "resolver"]
}),
new rsdoctorWebpackPlugin({
features: [
'resolver',
// ...other features
],
});
```

:::
Expand Down
9 changes: 6 additions & 3 deletions packages/document/docs/zh/guide/usage/resolver.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
- Resolver 分析能力默认关闭,如需开启,可以在 `features` 数组中添加 `resolver`,如下示例。[features 配置](../../config/options/options)

```js
new rsdoctorWebpackPlugin({
features: ["xxx", "xxx", "resolver"]
}),
new rsdoctorWebpackPlugin({
features: [
'resolver',
// ...other features
],
});
```

:::
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions scripts/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Custom Dictionary Words
antd
apng
applescript
atrules
biomejs
brotli
browserslistrc
bundleless
caniuse
chunkhash
Chunktmp
classname
compat
consolas
contentful
corejs
corepack
craco
crossorigin
datauri
deepmerge
docgen
envinfo
estree
facti
flac
flexbox
flexbugs
fnames
fullhash
icss
idents
iife
imagex
jfif
jiti
jscpuprofile
jsesc
koppers
lightningcss
longpaths
manypkg
mattcompiles
menlo
modularly
napi
nolyfill
ntqry
onclosetag
onopentag
ontext
osascript
outro
pageerror
pathinfo
perfetto
picocolors
pjpeg
pluggable
pmmmwh
postcssrc
preact
prebundle
preflights
prefresh
preprocessors
pxtorem
rebranded
rsbuild
rsdoctor
rsfamily
rslog
rspack
rspress
selfsign
sirv
sokra
speedscope
srcset
stacktracey
styl
subdir
subpage
subresource
svgr
swcrc
systemjs
tailwindcss
templating
transpiling
treeshaking
tsbuildinfo
tsdoc
unocss
unpatch
unplugin
unshift
upath
vitest
watchpack
webm
webp

0 comments on commit 03ec7a6

Please sign in to comment.