Redocly / Redocly/redocly-cli

Apply the closest redocly.yaml config to API docs

Open
#2,105 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Is your feature request related to a problem? Please describe.

Currently, the config from the folder where the Redocly CLI is executed is used. This makes configuration more difficult, as users must either maintain separate config files for different API definitions and use the --config option (so they won't be applied automatically), or configure the apis section to apply rules or decorators differently for different files.

Describe the solution you'd like

A potential solution is to use the nearest redocly.yaml config when running a command like lint or bundle on a specific API file.

TBD: this changes how we treat config itself, and potentially the lint-ignore file.
Main questions:

  • can we drop the apis section (since there will be no longer the 'main' config file)? (potentially, we can read and apply apis only when explicitly setting --config)
  • performance issues
  • how to save the lint-ignore files?
  • how would it work for the join command? do we need a common config for this kind of commands?
  • how to resolve config with the --config option set? should it simply override other config files?

Describe alternatives you've considered

Using current resolution method. The VS Code extension resolution method could be updated independently and Realm already resolves config independently.

Additional context

Originally came from the VS Code extension.

This could also be aligned with how Realm resolves config (see this comment).

As a part of this issue, we can stop supporting any default config file names other than redocly.yaml.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the lint and bundle commands currently resolve configuration, then compare the referenced VS Code extension and Realm resolution approaches. Clarify nearest redocly.yaml behavior, --config precedence, join handling, and lint-ignore storage before defining completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.