Skip to content

Commit

Permalink
Disable prefer-optional-catch-binding rule globally (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Sep 24, 2020
1 parent e630220 commit ef85dd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
}
}
},
"xo": {
"rules": {
"unicorn/prefer-optional-catch-binding": "off"
}
},
"nyc": {
"extension": [
".ts"
Expand Down
4 changes: 0 additions & 4 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class Conf<T extends Record<string, any> = Record<string, unknown>> implements I

try {
assert.deepEqual(fileStore, store);
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_) {
this.store = store;
}
Expand Down Expand Up @@ -369,10 +368,8 @@ class Conf<T extends Record<string, any> = Record<string, unknown>> implements I
const decipher = crypto.createDecipher(encryptionAlgorithm, this.#encryptionKey);
data = Buffer.concat([decipher.update(Buffer.from(data)), decipher.final()]).toString('utf8');
}
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_) { }
}
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_) {
}

Expand Down Expand Up @@ -402,7 +399,6 @@ class Conf<T extends Record<string, any> = Record<string, unknown>> implements I
try {
// TODO: Use `util.isDeepStrictEqual` when targeting Node.js 10
assert.deepEqual(newValue, oldValue);
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_) {
currentValue = newValue;
callback.call(this, newValue, oldValue);
Expand Down

0 comments on commit ef85dd0

Please sign in to comment.