Skip to content

Commit

Permalink
chore: Updated lint rule suppression comment (#2895)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr authored Jan 27, 2025
1 parent cb16516 commit 559dc98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/db/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function extractDatabaseChangeFromUse(sql) {
// The character ranges for this were pulled from
// http://dev.mysql.com/doc/refman/5.7/en/identifiers.html

// Suppressing a warning on this regex because it is not obvious what this
// regex does, and we don't want to break anything.
// eslint-disable-next-line sonarjs/slow-regex, sonarjs/duplicates-in-character-class
const match = /^\s*use[^\w`]+([\w$_\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql)
// The lint rule being suppressed here has been evaluated, and it has been
// determined that the regular expression is sufficient for our use case.
// eslint-disable-next-line sonarjs/slow-regex
const match = /^\s*use[^\w`]+([\w$\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql)
return (match && match[1]) || null
}

0 comments on commit 559dc98

Please sign in to comment.