Skip to content

Commit 559dc98

Browse files
authored
chore: Updated lint rule suppression comment (#2895)
1 parent cb16516 commit 559dc98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/db/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ function extractDatabaseChangeFromUse(sql) {
1111
// The character ranges for this were pulled from
1212
// http://dev.mysql.com/doc/refman/5.7/en/identifiers.html
1313

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

0 commit comments

Comments
 (0)