start upgrading eslint

This commit is contained in:
Matteo Pagliazzi
2019-10-08 16:57:10 +02:00
parent 90c917f69e
commit 621787915c
304 changed files with 5992 additions and 6394 deletions

View File

@@ -4,13 +4,13 @@ export function removePunctuationFromString (str) {
}
export function getMatchesByWordArray (str, wordsToMatch) {
let matchedWords = [];
let wordRegexs = wordsToMatch.map((word) => new RegExp(`\\b([^a-z]+)?${word}([^a-z]+)?\\b`, 'i'));
const matchedWords = [];
const wordRegexs = wordsToMatch.map(word => new RegExp(`\\b([^a-z]+)?${word}([^a-z]+)?\\b`, 'i'));
for (let i = 0; i < wordRegexs.length; i += 1) {
let regEx = wordRegexs[i];
let match = str.match(regEx);
const regEx = wordRegexs[i];
const match = str.match(regEx);
if (match !== null && match[0] !== null) {
let trimmedMatch = removePunctuationFromString(match[0]).trim();
const trimmedMatch = removePunctuationFromString(match[0]).trim();
matchedWords.push(trimmedMatch);
}
}