Skip to content

Commit

Permalink
Add an ignore for the eslint error
Browse files Browse the repository at this point in the history
babel-eslint 10.0.2 kicks up an error erroneously suggesting the
variables in the loop are unused. This wraps that section and tells
eslint to ignore it's erroneous error.

When we upgrade to 10.0.3, we can undo this.
  • Loading branch information
willkg committed Sep 6, 2019
1 parent 7c4c638 commit 36a6425
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ export const ShowValidationErrors = ({ errors, resetAndReload }) => {
export const parseQueryString = qs => {
const searchParams = new URLSearchParams(qs);
const parsed = {};
// NOTE(willkg): babel-eslint 10.0.2 erroneously kicks up this error. Once we
// upgrade to 10.0.3, we can get rid of this.
/* eslint-disable no-unused-vars */
for (let [key, value] of searchParams) {
const already = parsed[key];
if (already === undefined) {
Expand All @@ -212,6 +215,7 @@ export const parseQueryString = qs => {
parsed[key] = [already, value];
}
}
/* eslint-enable no-unused-vars */
return parsed;
};

Expand Down

0 comments on commit 36a6425

Please sign in to comment.