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

feat: Add linting rule to recursively check for Prisma includes using… #13652

Merged
merged 9 commits into from Apr 26, 2024

Conversation

Nis-Han
Copy link
Contributor

@Nis-Han Nis-Han commented Feb 13, 2024

… only 'true'
Implements #13577

What does this PR do?

Implements a linting rule that dissallows use of Prisma includes using only "true" and not a field selector.
It recursively checks for include parameters in Prisma query arguments so that even nested includes are checked.
If property is found and has a sub property with value as true, it will report an error.

Fixes #13577

https://www.loom.com/share/afb63c3348ce48ae976c129f66c6f10b?sid=6897eeb6-47bc-46b9-b632-6550d2518368

Error Example:

image

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update : If there is a developer doc, then yes

How should this be tested?

Pull the branch and try to voilate the rule, see if there is some error or not.

  • Are there environment variables that should be set?: Only the default ones
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR : ESlint Docs

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

Copy link

vercel bot commented Feb 13, 2024

@Nis-Han is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added foundation High priority Created by Linear-GitHub Sync labels Feb 13, 2024
Copy link
Contributor

github-actions bot commented Feb 13, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

Copy link
Contributor

github-actions bot commented Feb 13, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@keithwillcode keithwillcode added Medium priority Created by Linear-GitHub Sync and removed High priority Created by Linear-GitHub Sync labels Feb 13, 2024
@keithwillcode keithwillcode requested a review from a team February 13, 2024 16:16
@keithwillcode keithwillcode marked this pull request as draft February 13, 2024 17:06
@keithwillcode
Copy link
Contributor

We have a lot of places breaking this rule currently. Putting this in draft while we 1. clean them up or 2. add eslint ignore for now

@keithwillcode keithwillcode added this to the v3.9 milestone Feb 14, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Feb 29, 2024
@keithwillcode keithwillcode modified the milestones: v3.9, v4.0 Mar 5, 2024
@github-actions github-actions bot removed the Stale label Mar 6, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added Stale and removed Stale labels Mar 21, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Apr 9, 2024
@keithwillcode keithwillcode modified the milestones: v4.0, v4.1 Apr 15, 2024
@dosubot dosubot bot removed this from the v4.0 milestone Apr 15, 2024
@github-actions github-actions bot removed the Stale label Apr 16, 2024
@keithwillcode keithwillcode added this to the v4.1 milestone Apr 16, 2024
@keithwillcode keithwillcode marked this pull request as ready for review April 26, 2024 20:35
@keithwillcode keithwillcode self-assigned this Apr 26, 2024
@dosubot dosubot bot added the ✨ feature New feature or request label Apr 26, 2024
@keithwillcode keithwillcode enabled auto-merge (squash) April 26, 2024 21:14
@keithwillcode keithwillcode merged commit 7c35432 into calcom:main Apr 26, 2024
30 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request foundation Medium priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3087] Make linting rule disallowing use of Prisma includes using only "true" and not a field selector
2 participants