Skip to content

Commit aa4fa17

Browse files
committed
chore: Add task for running spellchecker locally
1 parent b5a7b9a commit aa4fa17

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.vscode/tasks.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"isDefault": true
1010
},
1111
"dependsOn": [
12-
"Run PSScriptAnalyzer linter"
12+
"Run PSScriptAnalyzer linter",
13+
"Run CSpell spell checker"
1314
]
1415
},
1516
{
@@ -46,6 +47,31 @@
4647
"$func-powershell-watch"
4748
]
4849
},
50+
{
51+
"label": "Run CSpell spell checker",
52+
"type": "shell",
53+
"options": {
54+
"shell": {
55+
"executable": "pwsh",
56+
"args": [
57+
"-NoProfile",
58+
"-Command"
59+
]
60+
}
61+
},
62+
// If npx is not available, warn that Node.js is not installed. If we cannot run cspell, try to install and run it, and warn if we still cannot run it.
63+
"command": "try { & npx -v > $null } catch {}; if (-not $?) { Write-Warning 'Node.js is not installed, so cannot download and run npx cspell.' } else { try { & npx cspell . } catch {}; if (-not $?) { & npm install cspell; & npx cspell . }; if (-not $?) { Write-Warning 'There was a problem installing or running cspell' } }",
64+
"group": "build",
65+
"presentation": {
66+
"reveal": "always",
67+
"panel": "dedicated",
68+
"clear": true,
69+
"group": "build"
70+
},
71+
"problemMatcher": [
72+
"$func-powershell-watch"
73+
]
74+
},
4975
{
5076
"label": "Run all Pester tests",
5177
"type": "shell",

0 commit comments

Comments
 (0)