Skip to content

Conversation

daweifeng-replit
Copy link

This PR adds rules to prevent string concatenation in query when using Drizzle ORM raw() function.

Reference: https://orm.drizzle.team/docs/sql#sqlraw

@CLAassistant
Copy link

CLAassistant commented May 13, 2025

CLA assistant check
All committers have signed the CLA.

@milanwilliams
Copy link
Contributor

@p4p3r If you have a moment to review, I'd appreciate. It's a rule request from the folks at Replit!

kurt-r2c
kurt-r2c previously approved these changes Jun 2, 2025
@kurt-r2c kurt-r2c dismissed their stale review June 2, 2025 18:45

dismissing so I can mark up some of the linter output

- patterns:
- pattern-either:
- pattern-inside: |
const { sql } = require('drizzle-orm')
Copy link
Contributor

Choose a reason for hiding this comment

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

Explicit const/var/let here necessitates coverage of the other two, unless you are certain that this will only ever be a const import. Not making this change will cause CI to throw linter errors on this rule.

- patterns:
- pattern-either:
- pattern-inside: |
const $DRIZZLE = require('drizzle-orm')
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

import { sql as $ALIAS } from 'drizzle-orm'
...
- pattern-inside: |
const { sql: $ALIAS } = require('drizzle-orm')
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

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.

4 participants