Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 6, 2022
1 parent 165129e commit 340ec09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/config/normalize/lib/star_dot_path/parsing/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -107,13 +106,15 @@ 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
state.hasRegExp = false
state.chars = ''
}

// eslint-disable-next-line complexity
const addChar = function (char, state) {
if (state.chars.length === 0) {
state.hasAny = state.hasAny || char === ANY
Expand Down
1 change: 0 additions & 1 deletion src/stats/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 340ec09

Please sign in to comment.