Skip to content

Commit adf384c

Browse files
committed
ci: eslint disable for regex
1 parent 67cc26e commit adf384c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/monitor-types/mqtt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class MqttMonitorType extends MonitorType {
5555
* @returns {RegExp} RegExp if the actual topic matches the subscribed topic
5656
*/
5757
static mqttTopicRegex(subscribedTopic) {
58-
/*eslint no-useless-escape: ["error", { "allowRegexCharacters": ["[", "]"] }]*/
58+
//eslint-disable-next-line
5959
subscribedTopic = subscribedTopic.replace("/([$.|?*{}()\[\]\\])/g", "\\$1"); // Escape special regex chars except + and #
60-
/*eslint no-useless-escape: ["error", { "allowRegexCharacters": ["+"] }]*/
60+
//eslint-disable-next-line
6161
subscribedTopic = subscribedTopic.replace("/+/g", "[^/]+"); // Replace + with regex for one or more characters except slash
6262
subscribedTopic = subscribedTopic.replace("/#/g", ".*"); // Replace # with regex for zero or more levels (including slashes)
6363
return new RegExp(`^${subscribedTopic}$`);

0 commit comments

Comments
 (0)