Skip to content

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

Merged
keithwillcode merged 9 commits into
calcom:mainfrom
Nis-Han:issue##13577
Apr 26, 2024
Merged

feat: Add linting rule to recursively check for Prisma includes using…#13652
keithwillcode merged 9 commits into
calcom:mainfrom
Nis-Han:issue##13577

Conversation

@Nis-Han
Copy link
Copy Markdown
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

@vercel
Copy link
Copy Markdown

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
@github-actions
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
p6l-richard pushed a commit to p6l-richard/cal.com-fork that referenced this pull request Jul 22, 2024
calcom#13652)

* feat: Add linting rule to recursively check for Prisma includes using only 'true'

* Fixing linting errors

* More linting fixes

* Disabled linting for forms

* Update recommended.ts

* Removed ignores

* Fixed warning

* Type fix

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
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