From 340ec097c2206b3cba8e7307b0904012160e9425 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 6 Mar 2022 17:37:58 +0100 Subject: [PATCH] Fix linting --- src/config/normalize/lib/star_dot_path/parsing/parse.js | 9 +++++---- src/stats/histogram.js | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config/normalize/lib/star_dot_path/parsing/parse.js b/src/config/normalize/lib/star_dot_path/parsing/parse.js index 4c57cd328..0a2d58953 100644 --- a/src/config/normalize/lib/star_dot_path/parsing/parse.js +++ b/src/config/normalize/lib/star_dot_path/parsing/parse.js @@ -65,8 +65,7 @@ const safeParseQuery = function (query) { } // Use imperative logic for performance -/* eslint-disable complexity, max-depth, max-statements, fp/no-loops, - fp/no-mutation */ +// eslint-disable-next-line complexity, max-statements const parseQuery = function (query) { if (query === '') { return [] @@ -82,9 +81,11 @@ const parseQuery = function (query) { hasRegExp: false, } + // eslint-disable-next-line fp/no-loops for (; state.index <= query.length; state.index += 1) { const char = query[state.index] + // eslint-disable-next-line max-depth if (char === ESCAPE) { addEscapedChar(query, state) } else if (char === SEPARATOR || state.index === query.length) { @@ -96,8 +97,6 @@ const parseQuery = function (query) { return path } -/* eslint-enable complexity, max-depth, max-statements, fp/no-loops, - fp/no-mutation */ const addEscapedChar = function (query, state) { state.index += 1 @@ -107,6 +106,7 @@ const addEscapedChar = function (query, state) { const addToken = function (path, state) { const tokenType = getStringTokenType(state) const token = tokenType.parse(state.chars) + // eslint-disable-next-line fp/no-mutating-methods path.push(token) state.hasAny = false state.hasMinus = false @@ -114,6 +114,7 @@ const addToken = function (path, state) { state.chars = '' } +// eslint-disable-next-line complexity const addChar = function (char, state) { if (state.chars.length === 0) { state.hasAny = state.hasAny || char === ANY diff --git a/src/stats/histogram.js b/src/stats/histogram.js index 4f202f8c7..88a7f78ba 100644 --- a/src/stats/histogram.js +++ b/src/stats/histogram.js @@ -83,7 +83,6 @@ const getBucket = function ({ const endIndex = binarySearch(array, end, startIndex, maxIndex) const frequency = (endIndex - startIndex) / length - // eslint-disable-next-line fp/no-mutation, no-param-reassign state.startIndex = endIndex return { start, end, frequency }