Skip to content

Instantly share code, notes, and snippets.

@jeremiah-snee-openx
Last active May 17, 2023 15:16
Show Gist options
  • Save jeremiah-snee-openx/819379304d227ab0352def058821f473 to your computer and use it in GitHub Desktop.
Save jeremiah-snee-openx/819379304d227ab0352def058821f473 to your computer and use it in GitHub Desktop.
cSpell Package Dictionary Generator

Code To Generate cSpell Dictionary from package.json

Makefile

cSpell:
  cat package.json | jq -r '.devDependencies, .dependencies | keys_unsorted | map(gsub("@"; "")) | map(split("/")) | flatten | unique[]' > ./.vscode/packages.txt

./.vscode/settings.json

{
  "cSpell.customDictionaries": {
    "project-words": {
      "name": "packages",
      "description": "Words used by packages in this project",
      "path": "${workspaceRoot}/.vscode/packages.txt",
      "addWords": true
    },
    "custom": true
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment