microsoft / microsoft/typespec

Config extends should it merge the linter entry

Open
#11,849 0 comments 1 reaction 0 assignees View on GitHub
compiler:core design:needed triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

Like we merge emitter options(Override per emitter) I think linter config entry should merge with the value from the config above.

```tsp
// In tspconfig.base.yaml
linter:
extends:
mylinter/all
```

```tsp
// In tspconfig.yaml
extends: tspconfig.base.yaml
linter:
disable:
mylinter/foo: "Exempted"
```

Here it would still pull the same extends as in the base but include the disabled.
This would just merge one level deeper that it does today for linter
- Right now: if you respecify `linter:` it just override the whole entry(Example above drop the extends)
- Porpose: Merge the content of linter. So specifying linter.disable just override linter.disable(We don't merge each disable entry

Contributor guide

Open the contributing guide

Research direction

Locate the configuration inheritance and merge handling, then find the existing tests for emitter-option or linter configuration merging. Reproduce the base and extending tspconfig.yaml example, verify that linter.extends is retained while linter.disable is overridden as a whole, and add coverage for the expected merged result.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.