Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(specs): add eslint rule to avoid cross-references #3413

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jul 24, 2024

🧭 What and Why

Suggested by @shortcuts, cross-reference are forbidden because they break our caching and generation strategy, we can add a custom rule to assert that.

The rule needs the list of clients because we allow everything inside each spec, just not with another spec.

@millotp millotp self-assigned this Jul 24, 2024
@millotp millotp requested a review from a team as a code owner July 24, 2024 12:27
@millotp millotp requested review from morganleroi and shortcuts July 24, 2024 12:27
@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 24, 2024

No code generated

If you believe code should've been generated, please, report the issue.

📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Rate
javascript 1362
php 1290
csharp 1025
java 878
ruby 876
python 725
swift 690
kotlin 491
go 465

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sooooo niceeeee gg!!

export const refCommon: Rule.RuleModule = {
meta: {
docs: {
description: 'the $ref must target the current spec, or the common spec',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make it more informative? E.g. "if you intended to use a model from an other spec, move it to the common folder" or something

shortcuts
shortcuts previously approved these changes Jul 24, 2024
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gggggggg

Copy link

github-actions bot commented Jul 24, 2024

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gggggg

@millotp millotp merged commit 81c15cf into main Jul 25, 2024
21 checks passed
@millotp millotp deleted the chore/rule-ref-common branch July 25, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants