⬆️(deps) migrate to typescript-eslint 8

A major version of typescript-eslint has been released. This version contains
some breaking change and rules change so we have to tweak our eslint
configuration.

https://main--typescript-eslint.netlify.app/blog/announcing-typescript-eslint-v8
This commit is contained in:
jbpenrath
2024-08-20 11:47:12 +02:00
committed by Jean-Baptiste PENRATH
parent a3eadc50db
commit b0b7061b7a
3 changed files with 11 additions and 3 deletions

View File

@@ -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"],

View File

@@ -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);
}
});

View File

@@ -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;
}