From 24ec67a4b227e10301f7a75a9c235fe2e8114d65 Mon Sep 17 00:00:00 2001 From: Chege Date: Sat, 15 Jun 2024 17:04:03 -0700 Subject: [PATCH] [Lint] Fix violations of `no-useless-escape` (#176) Makes reading strings easier. [1] Fixes 2 ES lint violations. 36 left till #162 is done. [1]: https://eslint.org/docs/latest/rules/no-useless-escape --- src/models/CardsMongoDB.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/CardsMongoDB.ts b/src/models/CardsMongoDB.ts index b698dff1..7d309b58 100644 --- a/src/models/CardsMongoDB.ts +++ b/src/models/CardsMongoDB.ts @@ -198,11 +198,11 @@ export function search( * `arrays dynamic_programming iterative-algorithms dynamic programming iterative algorithms` */ const splitTags = function(s: string): string { - const possibleTags = s.match(/[\w|\d]+(\_|-){1}[\w|\d]+/g); + const possibleTags = s.match(/[\w|\d]+(_|-){1}[\w|\d]+/g); if (possibleTags === null) { return s; } for (let i = 0; i < possibleTags.length; i++) { - s += " " + possibleTags[i].split(/[\_-]/g).join(" "); + s += " " + possibleTags[i].split(/[_-]/g).join(" "); } return s; };