Redocly / redocly-vs-code

Redocly VS Code extension
35 stars 6 forks source link

Use lint config from redocly.yaml apis section #28

Closed Marshevskyy closed 2 years ago

Marshevskyy commented 2 years ago

What should we improve?

Since introducing changes to the redocly.yaml config structure we can apply different lint rules to different files. The goal is to highlight errors and warnings in OpenAPI definition files according to the lint rules defined for them. The open question remains which lint config to use for files that are used in different root files via $ref reference.

How should we improve it?

VS Code should indicate which apis alias the current file is referring to and apply the appropriate lint config. In case there's more than one alias using the same root file it should apply the first alias from the apis section.

Why should we improve it?

It would help users understand how the specific config applies to different API definitions.

Describe alternatives you've considered

None

Additional context

This change is related to the OpenAPI CLI core package and most of the code should be implemented there. However, most of the changes are VS Code extension specific and should be implemented from the perspective of VS Code.

SmoliyY commented 2 years ago

Also currently we do not have suggestions and hints for build-in rules in config file, which will be good to add in scope of this story!

IgorKarpiuk commented 2 years ago

For files that are used in different root files via $ref reference we propose using the lint rules from the first apis section in which this file is used. @RomanHotsiy what do you think about it? Or maybe you can recommend better options?

RomanHotsiy commented 2 years ago

This is fine 👍