src/: TypeScript sources.extension.tswires activation, diagnostics, and settings;linter.tswraps thewrite-goodengine.out/: Compiled JavaScript. Generated bytsc; do not edit.- Config:
package.json(VS Code contributions, scripts),tsconfig.json,eslint.config.mjs. - CI:
.github/workflows/node.js.ymlruns install, compile, and lint on pushes/PRs. - Workspace:
.vscode/contains local launch/debug config for Extension Development Host.
npm ci: Clean install dependencies (used in CI).npm run compile: Build TypeScript toout/.npm run watch: Incremental rebuild during development.npm run lint: Lintsrc/**/*.tsvia ESLint.- Run locally: Open in VS Code and press F5 to launch the Extension Development Host; open a Markdown file to see diagnostics.
- Publish (maintainers):
vsce publishafternpm run compileandnpm run lint.
- Language: TypeScript. Indent 4 spaces; end statements with semicolons.
- Names:
camelCasefor variables/functions,PascalCasefor types/interfaces, short lowercase filenames (e.g.,extension.ts). - Linting: ESLint with
@typescript-eslint. Enforced rules includesemi: always; some strict TS rules are relaxed. Runnpm run lintand fix warnings.
- End-to-end tests:
@vscode/test-electron+ Mocha/Chai. - Structure:
test/runTest.ts(boot),test/suite/*.test.ts(specs), fixtures undertest/fixtures/ws/. - Commands:
npm test(headless by default),npm run test:gui(shows Dev Host),npm run test:ci(forces headless; used in CI). - Scenarios: diagnostics for Markdown, language filtering, "only lint on save", and debounce behavior.
- Tips: set
write-good.debounce-time-in-msto0for deterministic checks unless testing debounce; create temp files in tests to avoid cross-test state.
- Commits: Imperative, concise subject (≤72 chars). Example:
lint: fix debounce handling in onDidChange. - Reference issues/PRs when relevant (e.g.,
Fixes #123). - PRs must: describe intent and approach, list user-facing changes (settings/diagnostics), include before/after screenshots or GIFs when behavior changes, and pass CI (install, compile, lint).
- Key settings forwarded to
write-good:- Example
settings.jsonsnippet:{ "write-good.languages": ["markdown", "plaintext"], "write-good.only-lint-on-save": false, "write-good.debounce-time-in-ms": 200, "write-good.write-good-config": { "eprime": true } }
- Example
- Avoid editing
out/; make changes insrc/and rebuild.