Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Add words to cspell.json after setup if they would cause lint:spelling to error #702

Closed
3 tasks done
JoshuaKGoldberg opened this issue Aug 25, 2023 · 1 comment 路 Fixed by #1208
Closed
3 tasks done
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

pnpm run lint:spelling runs cspell to check for spelling issues. But sometimes folks add new words in setup scripts that introduce complaints. For example, if you run npx template-typescript-node-package --name rickastley, pnpm run lint:spelling in the new app will likely complain that rickastley is an unknown word.

#381 (have cspell automatically detect values from the package) would be the ideal solution here. But it's blocked on streetsidesoftware/cspell#3215.

In the meantime, I'd propose that at the end of setup, the template should:

  1. Run cspell and capture any word failures
  2. Add those failures to cspell.json

Additional Info

Does cspell have a Node / programmatic API documented anywhere? It surely must given that it has a VS Code extension... The closest I could find was streetsidesoftware/cspell#4415 & linked issues. Maybe it'd be good to file an issue asking for docs on cspell?

@JoshuaKGoldberg JoshuaKGoldberg added type: feature New enhancement or request status: accepting prs Please, send a pull request to resolve this! labels Aug 25, 2023
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Dec 31, 2023
JoshuaKGoldberg added a commit that referenced this issue Jan 9, 2024
## PR Checklist

- [x] Addresses an existing open issue: fixes #702
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Runs `pnpm lint:spelling` and matches `Unknown word (...)` complaints.

Also standardizes two things in code that were bugging me:

* `node:fs/promises` imports as `import * as fs`
* Using `formatJson` instead of manually `prettier.format` calls

This finally means that the file creator for `cspell.json` no longer
needs to prepopulate with a static list of words. So unnecessary ignored
words will no longer be potentially introduced by that. Yay.
Copy link

馃帀 This is included in version v1.54.0 馃帀

The release is available on:

Cheers! 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant