diff --git a/packages/eslint-config-custom/.eslintrc.json b/packages/eslint-config-custom/.eslintrc.json index 0eb459e..53157b4 100644 --- a/packages/eslint-config-custom/.eslintrc.json +++ b/packages/eslint-config-custom/.eslintrc.json @@ -99,7 +99,13 @@ "react/prop-types": "off", "react/react-in-jsx-scope": "off", "react/require-default-props": "off", - "react/style-prop-object": ["error", { "allow": ["FormattedNumber"] }] + "react/style-prop-object": ["error", { "allow": ["FormattedNumber"] }], + /* + The two following rules can be removed once airbnb-typescript will be updated (18.0.0) + https://github.com/iamturns/eslint-config-airbnb-typescript/issues/354 + */ + "@typescript-eslint/no-throw-literal": "off", + "@typescript-eslint/only-throw-error": "error" }, "settings": { "polyfills": ["fetch", "Promise"], diff --git a/packages/react/cunningham.ts b/packages/react/cunningham.ts index ff7e494..d858382 100644 --- a/packages/react/cunningham.ts +++ b/packages/react/cunningham.ts @@ -26,7 +26,8 @@ files.forEach((file) => { .replace(sep, "-"); components[componentName] = res.tokens(defaultTokenRefs); - } catch (error) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (_error) { throw new Error("Could not find component name from file path " + file); } }); diff --git a/packages/react/src/components/Forms/DatePicker/utils.ts b/packages/react/src/components/Forms/DatePicker/utils.ts index c38e554..aa6a32e 100644 --- a/packages/react/src/components/Forms/DatePicker/utils.ts +++ b/packages/react/src/components/Forms/DatePicker/utils.ts @@ -25,7 +25,8 @@ export const isValidTimeZone = (timezone: string) => { Intl.DateTimeFormat(undefined, { timeZone: timezone }); return true; - } catch (error) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (_error) { // If an error occurs, it could be due to an invalid time zone or lack of Intl support return false; }