Skip to content

Commit

Permalink
chore: add cspell check
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlu-tw committed Mar 4, 2024
1 parent c020990 commit 064489d
Show file tree
Hide file tree
Showing 9 changed files with 646 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .cspell/name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Custom Dictionary Words
alanlu
antfu
dbaeumer
esbenp
Anson
3 changes: 3 additions & 0 deletions .cspell/other.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Custom Dictionary Words
typecheck
stroustrup
5 changes: 5 additions & 0 deletions .cspell/repo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Custom Dictionary Words
commitlint
mastercss
nuxt
tsup
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,53 @@ jobs:
- name: TypeCheck
run: pnpm run typecheck

- name: cspell
uses: streetsidesoftware/cspell-action@v6
with:
# Define glob patterns to filter the files to be checked. Use a new line between patterns to define multiple patterns.
# The default is to check ALL files that were changed in in the pull_request or push.
# Note: `ignorePaths` defined in cspell.json still apply.
# Example:
# files: |
# **/*.{ts,js}
# !dist/**/*.{ts,js}
#
# Default: ALL files
files: ''

# Check files and directories starting with `.`.
# - "true" - glob searches will match against `.dot` files.
# - "false" - `.dot` files will NOT be checked.
# - "explicit" - glob patterns can match explicit `.dot` patterns.
check_dot_files: explicit

# The point in the directory tree to start spell checking.
# Default: .
root: '.'

# Notification level to use with inline reporting of spelling errors.
# Allowed values are: warning, error, none
# Default: warning
inline: warning

# Determines if the action should be failed if any spelling issues are found.
# Allowed values are: true, false
# Default: true
strict: true

# Limit the files checked to the ones in the pull request or push.
incremental_files_only: true

# Path to `cspell.json`
config: '.'

# Log progress and other information during the action execution.
# Default: false
verbose: false

# Use the `files` setting found in the CSpell configuration instead of `input.files`.
use_cspell_files: true

test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
'*': 'cspell --no-progress --no-must-find-files',
'*.json': ['eslint --fix', 'prettier --write'],
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.vue': ['eslint --fix', 'prettier --write'],
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["EditorConfig.EditorConfig", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "DavidAnson.vscode-markdownlint"]
"recommendations": ["EditorConfig.EditorConfig", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "DavidAnson.vscode-markdownlint", "streetsidesoftware.code-spell-checker"]
}
26 changes: 26 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["node_modules", "pnpm-lock.yaml"],
"dictionaryDefinitions": [
{
"name": "name",
"path": "./.cspell/name.txt",
"addWords": true
},
{
"name": "repo",
"path": "./.cspell/repo.txt",
"addWords": true
},
{
"name": "other",
"path": "./.cspell/other.txt",
"addWords": true
}
],
"dictionaries": ["name", "repo", "other"],
"words": [],
"ignoreWords": [],
"import": []
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
"modules:clean": "npx rimraf --glob ./**/node_modules && rm -rf pnpm-lock.yaml",
"pnpm:clean": "pnpm store prune",
"build": "turbo run build",
"check": "turbo run test lint typecheck --parallel",
"check": "turbo run test lint typecheck --parallel && pnpm lint:cspell",
"test": "turbo run test",
"lint": "turbo run lint",
"typecheck": "turbo run typecheck",
"lint:cspell": "pnpm cspell . --unique --no-progress --no-must-find-files",
"nuxt-demo": "pnpm --filter=@alanlu-dev/nuxt-demo",
"commit": "czg",
"changeset": "changeset",
Expand All @@ -42,6 +43,7 @@
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"cspell": "^8.5.0",
"czg": "^1.9.0",
"eslint": "^8.57.0",
"husky": "^9.0.11",
Expand Down
Loading

0 comments on commit 064489d

Please sign in to comment.