Repository navigation
Support linter configuration overrides from the CLI - #12195
Timothee Guerin (timotheeguerin) wants to merge 5 commits into
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
There was a problem hiding this comment.
🟡 Changes recommended
Invalid inherited rule options still block compilation even when CLI overrides replace or disable them.
1 open finding
What changed in this PR
Adds runtime-only linter overrides to the TypeSpec compiler CLI without modifying project configuration.
Changes:
- Adds ruleset selection, per-rule overrides, and lint disabling.
- Adds unit and end-to-end coverage.
- Documents flags, precedence, and path resolution.
| File | Description |
|---|---|
| website/src/content/docs/docs/handbook/configuration/configuration.mdx | Documents override behavior. |
| website/src/content/docs/docs/handbook/cli.md | Introduces linter flags. |
| packages/compiler/test/e2e/cli/scenarios/linter/using-only.yaml | Adds ruleset fixture. |
| packages/compiler/test/e2e/cli/scenarios/linter/tspconfig.yaml | Configures scenario linting and emission. |
| packages/compiler/test/e2e/cli/scenarios/linter/main.tsp | Supplies lint-triggering source. |
| packages/compiler/test/e2e/cli/cli.e2e.ts | Tests CLI behavior. |
| packages/compiler/test/core/linter.test.ts | Updates diagnostic expectation. |
| packages/compiler/test/cli.test.ts | Tests override parsing and precedence. |
| packages/compiler/src/core/types.ts | Clarifies file-reference documentation. |
| packages/compiler/src/core/program.ts | Applies runtime overrides. |
| packages/compiler/src/core/options.ts | Adds internal override options. |
| packages/compiler/src/core/messages.ts | Adds flag diagnostics. |
| packages/compiler/src/core/linter.ts | Updates origin commentary. |
| packages/compiler/src/core/cli/cli.ts | Registers linter flags. |
| packages/compiler/src/core/cli/actions/compile/args.ts | Parses and resolves overrides. |
| .chronus/changes/feat-cli-linter-config-2026-9-14-22-11-54.md | Announces the feature. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Changing lint policy for a single compilation currently requires editing
tspconfig.yamlor maintaining a separate config, even when the goal is just to skip linting or try another ruleset.Add runtime-only overrides without changing the project's configuration:
--linter-rulesetcan be repeated and accepts library rulesets orfile:YAML references. It replaces the configuredextendslist while preserving configured per-rule settings. CLI file paths resolve from the working directory.--linter-ruleacceptstrue,false, or a JSON options object and takes precedence over configured rule settings.--no-linterdisables lint rules without suppressing compiler diagnostics or emitters, and cannot be combined with either override flag.