This project enforces strict documentation at multiple levels: JSDoc via ESLint, TypeDoc for API docs, README.md per directory, and spell checking. All checks run in CI and pre-commit hooks.
# Generate HTML documentation (0 warnings required)
npm run docs
# Validate documentation coverage
npm run docs:coverage
# Check README.md exists in every directory
npm run docs:check-readmes
# Combined check (READMEs + TypeDoc validation)
npm run docs:check
# Generate Markdown documentation
npm run docs:markdown
# Watch mode for development
npm run docs:watch
# Spell check source files
npm run check:spellingAll enforced at error level via eslint-plugin-jsdoc. See eslint.config.mjs for full config.
- Exported functions, classes, methods, interfaces, and type aliases
- Every function parameter (
@param) - Every non-void return value (
@returns) - Every
throwstatement (@throws)
/**
* Connects the webview document to a remote Datalayer runtime kernel.
*
* @param uri - The document URI identifying which webview to target.
* @param runtime - The runtime configuration with ingress URL and auth token.
* @returns The kernel connection ID for tracking.
* @throws When no webview is registered for the given URI.
*/
export function connectWebviewDocument(
uri: string,
runtime: RuntimeDTO,
): string {- Descriptions start with uppercase, end with period
@paramuses hyphen separator:@param name - Description.- No
{type}annotations (TypeScript handles types) - Don't restate the name:
@param uri - The URI.is rejected - Tags ordered:
@param->@returns->@throws->@see/@since - No
@exampletags (internal extension, not public API) - No empty
/** */blocks - Constructor
@paramfor private params exempt (TypeDoc conflict)
Test files (*.test.ts, test/**) are exempt from: require-jsdoc, require-param, require-returns, require-throws, informative-docs, match-description.
Settings in typedoc.json:
treatWarningsAsErrors: true- Warnings fail the buildnotDocumented: true- Undocumented exports flaggedinvalidLink: true- Broken{@link}references flaggedexcludePrivate: true- Private members excludedrequiredToBeDocumented: Class, Function, Enum, Interface, TypeAlias, Variable, Method
Use only these tags (others will cause warnings):
@param,@returns,@throws- Function documentation@see,@since,@deprecated- Cross-references and versioning@module- Module-level documentation@internal- Exclude from documentation@remarks- Additional implementation details
Do NOT use: @class, @static, @async, @extends, @constructor, @export, @description, @typedef - TypeDoc infers these from TypeScript.
Every directory under src/, webview/, and scripts/ must have a README.md documenting:
- What the directory contains and its purpose
- Every file with a description of exports, patterns, and key details
- Subdirectories with brief descriptions
Enforced by scripts/check-readmes.sh and included in npm run check. Currently 69 directories covered.
Uses cspell with a domain-specific dictionary in cspell.json. Run npm run check:spelling to check. Add new domain words to the words array in cspell.json.
The GitHub Actions Code Quality workflow runs on every PR:
- Format check (Prettier)
- Lint (ESLint with 17+ JSDoc rules)
- Type check (TypeScript strict mode)
- README check (every directory)
- TypeDoc generation and validation (0 warnings)
- Spell check (cspell)
- Generated docs:
docs/directory (git-ignored) - Live site: vscode-datalayer.netlify.app (auto-deployed)