@travetto/lint
v8.0.2
Published
Linting and Formatting integration for Travetto
Maintainers
Readme
Lint Support
Linting and Formatting integration for Travetto
Install: @travetto/lint
npm install @travetto/lint
# or
yarn add @travetto/lintOxlint, Oxfmt, and CSpell are the tools used for linting, formatting, and spell checking in Typescript and Javascript code. This module provides a unified CLI interface and standard linting, formatting, and spell checking configurations. In a new project, the first thing that will need to be done, post installation, is to register the configuration files.
CLI - lint:register
Terminal: Help for lint:register
$ trv lint:register --help
Usage: lint:register [options]
Description:
Generate the workspace oxlint, oxfmt, and cspell configuration entry files.
This bootstraps `oxlint.config.ts`, `oxfmt.config.ts`, and `cspell.json` to extend the framework-provided rules and formatting configuration.
Options:
--help display help for commandWhen registration completes, this bootstraps the configuration files the linter, formatter, and spell checker will use, as well as editor tooling (e.g. IDEs).
CLI - lint:check
Linting is performed via the check command:
Terminal: Running the Linter
npx trv lint:checkTerminal: Help for lint:check
$ trv lint:check --help
Usage: lint:check [options]
Description:
Run oxlint linter for the workspace or changed files.
Supports incremental mode (`changed`/`since`) and forwards fix
options to the underlying oxlint invocation.
Options:
-c, --changed Only check changed modules (default: false)
-s, --since <string> Since a specific git commit
-f, --fix Should we attempt to auto-fix lint errors? (default: false)
--help display help for commandCLI - lint:format
Formatting is performed via the format command:
Terminal: Running the Formatter
npx trv lint:formatTerminal: Help for lint:format
$ trv lint:format --help
Usage: lint:format [options]
Description:
Run oxfmt formatter for the workspace or changed files.
Formats files in place by default. Use `--check` for read-only verification.
Options:
--changed Only format changed modules (default: false)
-s, --since <string> Since a specific git commit
-c, --check Report formatting violations without writing changes (default: false)
--help display help for commandCLI - lint:spell
Spell checking is performed via the spell command:
Terminal: Running the Spell Checker
npx trv lint:spellTerminal: Help for lint:spell
$ trv lint:spell --help
Usage: lint:spell [options]
Description:
Run cspell spell checker for the workspace or changed files.
Supports incremental mode (`changed`/`since`) and forwards options
to the underlying cspell invocation.
Options:
-c, --changed Only check changed modules (default: false)
-s, --since <string> Since a specific git commit
-j, --json Output format as JSON (default: false)
--help display help for command