Fine-tuning the @typescript-eslint/no-unused-vars rule

We now allow parameters to be unused. This is quite common in inherited methods.
This allows removing a bunch of: //eslint-disable-next-line @typescript-eslint/no-unused-vars
Also, "err" variables in catch MUST now be used and the special _exhaustiveCheck variable used in ":never" assigns can be unused.
This commit is contained in:
David Négrier
2022-04-22 17:46:02 +02:00
parent db11a465ef
commit 5cc97483e0
20 changed files with 15 additions and 76 deletions
+2 -1
View File
@@ -40,12 +40,13 @@ class AdminApi implements AdminInterface {
try {
authTokenData = jwtTokenManager.verifyJWTToken(authToken);
userId = authTokenData.identifier;
//eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
try {
// Decode token, in this case we don't need to create new token.
authTokenData = jwtTokenManager.verifyJWTToken(authToken, true);
userId = authTokenData.identifier;
console.info("JWT expire, but decoded", userId);
console.info("JWT expire, but decoded:", userId);
} catch (e) {
if (e instanceof InvalidTokenError) {
throw new Error("Token decrypted error");