diff --git a/.changeset/large-moose-drop.md b/.changeset/large-moose-drop.md new file mode 100644 index 000000000..4fb805d1f --- /dev/null +++ b/.changeset/large-moose-drop.md @@ -0,0 +1,5 @@ +--- +"@scaleway/eslint-config-react": major +--- + +remove usage of eslint-config-airbnb-typescript as it's not maintain anymore, migrate to stylistic package diff --git a/eslint.config.mjs b/eslint.config.mjs index e056b9ac4..fa958d730 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,17 @@ export default [ ], }, { + settings: { + react: { + pragma: 'React', // Pragma to use, default to "React" + fragment: 'Fragment', // Fragment to use (may be a property of ), default to "Fragment" + version: 'detect', // React version. "detect" automatically picks the version you have installed. + // You can also use `16.0`, `16.3`, etc, if you want to override the detected value. + // Defaults to the "defaultVersion" setting and warns if missing, and to "detect" in the future + defaultVersion: '18', // Default React version to use when the version you have installed cannot be detected. + // If not provided, defaults to the latest React version. + }, + }, languageOptions: { globals: { ...globals.browser, @@ -65,23 +76,6 @@ export default [ project: ['tsconfig.json'], }, }, - })), - ...scwTypescript.map(config => ({ - ...config, - files: [ - 'packages/changesets-renovate/**/*.ts{x,}', - 'packages/validate-icu-locales/**/*.ts{x,}', - '**/__tests__/**/*.ts{x,}', - ], - - languageOptions: { - ecmaVersion: 5, - sourceType: 'script', - - parserOptions: { - project: ['tsconfig.json'], - }, - }, rules: { ...config.rules, @@ -93,7 +87,6 @@ export default [ { files: [ - 'packages/jest-helpers/**/*.ts{x,}', '**/__tests__/**/*.ts{x,}', '**/vitest.setup.ts', '**/*.config.ts', diff --git a/package.json b/package.json index 19412b08b..2faeefdcc 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "builtin-modules": "4.0.0", "cross-env": "7.0.3", "esbuild-plugin-browserslist": "0.15.0", - "eslint": "9.13.0", - "globals": "15.12.0", + "eslint": "9.16.0", + "globals": "15.13.0", "happy-dom": "15.11.7", "husky": "9.1.7", "lint-staged": "15.2.10", diff --git a/packages/cookie-consent/package.json b/packages/cookie-consent/package.json index b092f7434..f2851306d 100644 --- a/packages/cookie-consent/package.json +++ b/packages/cookie-consent/package.json @@ -44,7 +44,6 @@ "cookie": "1.0.1" }, "devDependencies": { - "@types/cookie": "0.6.0", "react": "18.3.1", "@scaleway/use-segment": "workspace:*" }, diff --git a/packages/cookie-consent/src/CookieConsentProvider/__tests__/index.test.tsx b/packages/cookie-consent/src/CookieConsentProvider/__tests__/index.test.tsx index 84d00e4bb..20c5007eb 100644 --- a/packages/cookie-consent/src/CookieConsentProvider/__tests__/index.test.tsx +++ b/packages/cookie-consent/src/CookieConsentProvider/__tests__/index.test.tsx @@ -44,9 +44,9 @@ const integrations: Integrations = [ }, ] -const mockUseSegmentIntegrations = vi.fn< - () => ReturnType ->(() => ({ +type MockSegmentIntegrations = () => ReturnType + +const mockUseSegmentIntegrations = vi.fn(() => ({ integrations, isLoaded: true, })) diff --git a/packages/cookie-consent/src/CookieConsentProvider/types.ts b/packages/cookie-consent/src/CookieConsentProvider/types.ts index 98edd9f5c..3bf5e5e4e 100644 --- a/packages/cookie-consent/src/CookieConsentProvider/types.ts +++ b/packages/cookie-consent/src/CookieConsentProvider/types.ts @@ -3,7 +3,10 @@ import type { CategoryKind } from './helpers' export type { CategoryKind } export type Consent = { [K in CategoryKind]: boolean } -type Integration = { category: CategoryKind; name: string } +type Integration = { + category: CategoryKind + name: string +} export type Integrations = Integration[] diff --git a/packages/eslint-config-react/airbnb/typescript.mjs b/packages/eslint-config-react/airbnb/typescript.mjs new file mode 100644 index 000000000..d7f13fda3 --- /dev/null +++ b/packages/eslint-config-react/airbnb/typescript.mjs @@ -0,0 +1,192 @@ +import { fixupConfigRules, fixupPluginRules } from '@eslint/compat' +import { FlatCompat } from '@eslint/eslintrc' +import path from 'node:path' +import { fileURLToPath } from 'node:url' + +const filename = fileURLToPath(import.meta.url) +const dirname = path.dirname(filename) + +const compat = new FlatCompat({ + baseDirectory: dirname, +}) + +const config = compat.extends('airbnb-base') + +const defaultAirBnbRules = [...fixupPluginRules(config)].reduce( + (acc, currentConfig) => ({ + ...acc, + ...currentConfig.rules, + }), + {}, +) + +export default [ + ...fixupConfigRules(compat.extends('airbnb-base')), + { + rules: { + // Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention' + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md + camelcase: 'off', + // The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this. + '@typescript-eslint/naming-convention': [ + 'error', + // Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10) + { + selector: 'variable', + format: ['camelCase', 'PascalCase', 'UPPER_CASE'], + }, + // Allow camelCase functions (23.2), and PascalCase functions (23.8) + { + selector: 'function', + format: ['camelCase', 'PascalCase'], + }, + // Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make TypeScript recommendations, we are assuming this rule would similarly apply to anything "type like", including interfaces, type aliases, and enums + { + selector: 'typeLike', + format: ['PascalCase'], + }, + ], + + // Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': + defaultAirBnbRules['default-param-last'], + + // Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': defaultAirBnbRules['dot-notation'], + + // Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': + defaultAirBnbRules['no-array-constructor'], + + // Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': + defaultAirBnbRules['no-dupe-class-members'], + + // Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': + defaultAirBnbRules['no-empty-function'], + + // Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md + 'no-extra-parens': 'off', + '@typescript-eslint/no-extra-parens': + defaultAirBnbRules['no-extra-parens'], + + // Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md + 'no-implied-eval': 'off', + 'no-new-func': 'off', + '@typescript-eslint/no-implied-eval': + defaultAirBnbRules['no-implied-eval'], + + // Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md + 'no-loss-of-precision': 'off', + '@typescript-eslint/no-loss-of-precision': + defaultAirBnbRules['no-loss-of-precision'], + + // Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md + 'no-loop-func': 'off', + '@typescript-eslint/no-loop-func': defaultAirBnbRules['no-loop-func'], + + // Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': + defaultAirBnbRules['no-magic-numbers'], + + // Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': defaultAirBnbRules['no-redeclare'], + + // Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': defaultAirBnbRules['no-shadow'], + + // Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': + defaultAirBnbRules['no-unused-expressions'], + + // Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': defaultAirBnbRules['no-unused-vars'], + + // Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': + defaultAirBnbRules['no-use-before-define'], + + // Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': + defaultAirBnbRules['no-useless-constructor'], + + // Replace Airbnb 'quotes' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md + quotes: 'off', + // '@typescript-eslint/quotes': defaultAirBnbRules.quotes, + + // Replace Airbnb 'require-await' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md + 'require-await': 'off', + '@typescript-eslint/require-await': defaultAirBnbRules['require-await'], + + // Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md + 'no-return-await': 'off', + '@typescript-eslint/return-await': [ + defaultAirBnbRules['no-return-await'], + 'in-try-catch', + ], + + // Append 'ts' and 'tsx' to Airbnb 'import/extensions' rule + // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md + 'import/extensions': [ + defaultAirBnbRules['import/extensions'][0], + defaultAirBnbRules['import/extensions'][1], + { + ...defaultAirBnbRules['import/extensions'][2], + ts: 'never', + tsx: 'never', + }, + ], + + // Append 'ts' and 'tsx' extensions to Airbnb 'import/no-extraneous-dependencies' rule + // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md + 'import/no-extraneous-dependencies': [ + defaultAirBnbRules['import/no-extraneous-dependencies'][0], + { + ...defaultAirBnbRules['import/no-extraneous-dependencies'][1], + devDependencies: defaultAirBnbRules[ + 'import/no-extraneous-dependencies' + ][1].devDependencies.reduce((result, devDep) => { + const toAppend = [devDep] + const devDepWithTs = devDep.replace(/\bjs(x?)\b/g, 'ts$1') + if (devDepWithTs !== devDep) { + toAppend.push(devDepWithTs) + } + return [...result, ...toAppend] + }, []), + }, + ], + }, + }, +] diff --git a/packages/eslint-config-react/index.mjs b/packages/eslint-config-react/index.mjs index cd9e5566f..b76a45714 100644 --- a/packages/eslint-config-react/index.mjs +++ b/packages/eslint-config-react/index.mjs @@ -1,5 +1,6 @@ import emotion from './emotion.mjs' import javascript from './javascript.mjs' import typescript from './typescript.mjs' +import stylistic from './stylistic.mjs' -export { emotion, javascript, typescript } +export { emotion, javascript, stylistic, typescript } diff --git a/packages/eslint-config-react/package.json b/packages/eslint-config-react/package.json index fb2edf4d3..1de485468 100644 --- a/packages/eslint-config-react/package.json +++ b/packages/eslint-config-react/package.json @@ -20,24 +20,27 @@ "./javascript": "./javascript.mjs", "./typescript": "./typescript.mjs", "./emotion": "./emotion.mjs", - "./shared": "./shared.mjs" + "./shared": "./shared.mjs", + "./stylistic": "./stylistic.mjs" }, "files": [ + "airbnb/*", + "emotion.mjs", "index.mjs", "javascript.mjs", - "typescript.mjs", "shared.mjs", - "emotion.mjs" + "stylistic.mjs", + "typescript.mjs" ], "license": "MIT", "dependencies": { "@emotion/eslint-plugin": "11.12.0", "@eslint/compat": "1.2.3", "@eslint/eslintrc": "3.2.0", - "@typescript-eslint/eslint-plugin": "7.18.0", - "@typescript-eslint/parser": "7.18.0", + "@stylistic/eslint-plugin": "2.11.0", + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", "eslint-config-airbnb": "19.0.4", - "eslint-config-airbnb-typescript": "18.0.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-deprecation": "3.0.0", "eslint-plugin-eslint-comments": "3.2.0", @@ -47,7 +50,7 @@ "eslint-plugin-react-hooks": "5.0.0" }, "peerDependencies": { - "eslint": ">= 9.7" + "eslint": ">= 9.13" }, "devDependencies": { "eslint": "9.13.0", diff --git a/packages/eslint-config-react/shared.mjs b/packages/eslint-config-react/shared.mjs index 3a8c2fb0a..1355dd680 100644 --- a/packages/eslint-config-react/shared.mjs +++ b/packages/eslint-config-react/shared.mjs @@ -2,6 +2,7 @@ import { fixupConfigRules } from '@eslint/compat' import { FlatCompat } from '@eslint/eslintrc' import path from 'node:path' import { fileURLToPath } from 'node:url' +import stylisticJs from './stylistic.mjs' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) @@ -19,9 +20,13 @@ export default [ 'plugin:react/jsx-runtime', ), ), + ...stylisticJs, { rules: { curly: 'error', + 'no-use-before-define': 'off', + 'import/extensions': 'off', + 'dot-notation': 'off', 'import/order': [ 'error', diff --git a/packages/eslint-config-react/stylistic.mjs b/packages/eslint-config-react/stylistic.mjs new file mode 100644 index 000000000..cae89af48 --- /dev/null +++ b/packages/eslint-config-react/stylistic.mjs @@ -0,0 +1,68 @@ +import { fixupPluginRules } from '@eslint/compat' +import { FlatCompat } from '@eslint/eslintrc' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import stylisticPlugin from '@stylistic/eslint-plugin' + +const filename = fileURLToPath(import.meta.url) +const dirname = path.dirname(filename) + +const compat = new FlatCompat({ + baseDirectory: dirname, +}) + +const config = compat.extends('airbnb-base') + +const defaultAirBnbRules = [...fixupPluginRules(config)].reduce( + (acc, currentConfig) => ({ + ...acc, + ...currentConfig.rules, + }), + {}, +) + +export default [ + { + plugins: { + '@stylistic': stylisticPlugin, + }, + }, + stylisticPlugin.configs['disable-legacy'], + stylisticPlugin.configs['recommended-flat'], + { + rules: { + '@stylistic/quotes': 'off', + '@stylistic/operator-linebreak': 'off', + '@stylistic/indent': 'off', + '@stylistic/quote-props': 'off', + '@stylistic/indent-binary-ops': 'off', + '@stylistic/arrow-parens': 'off', + + '@stylistic/brace-style': defaultAirBnbRules['brace-style'], + '@stylistic/comma-dangle': [ + defaultAirBnbRules['comma-dangle'][0], + { + ...defaultAirBnbRules['comma-dangle'][1], + enums: defaultAirBnbRules['comma-dangle'][1].arrays, + generics: defaultAirBnbRules['comma-dangle'][1].arrays, + tuples: defaultAirBnbRules['comma-dangle'][1].arrays, + }, + ], + '@stylistic/comma-spacing': defaultAirBnbRules['comma-spacing'], + '@stylistic/func-call-spacing': defaultAirBnbRules['func-call-spacing'], + '@stylistic/keyword-spacing': defaultAirBnbRules['keyword-spacing'], + '@stylistic/no-extra-semi': defaultAirBnbRules['no-extra-semi'], + '@stylistic/object-curly-spacing': + defaultAirBnbRules['object-curly-spacing'], + semi: 'off', + '@stylistic/semi': 'off', + '@stylistic/space-before-blocks': + defaultAirBnbRules['space-before-blocks'], + '@stylistic/space-before-function-paren': + defaultAirBnbRules['space-before-function-paren'], + '@stylistic/space-infix-ops': defaultAirBnbRules['space-infix-ops'], + '@stylistic/lines-between-class-members': + defaultAirBnbRules['lines-between-class-members'], + }, + }, +] diff --git a/packages/eslint-config-react/typescript.mjs b/packages/eslint-config-react/typescript.mjs index 308e867ec..efc84b4ad 100644 --- a/packages/eslint-config-react/typescript.mjs +++ b/packages/eslint-config-react/typescript.mjs @@ -4,6 +4,7 @@ import deprecation from 'eslint-plugin-deprecation' import path from 'node:path' import { fileURLToPath } from 'node:url' import shared from './shared.mjs' +import airbnbTypescript from './airbnb/typescript.mjs' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) @@ -15,12 +16,12 @@ const compat = new FlatCompat({ export default [ ...fixupConfigRules( compat.extends( - 'eslint-config-airbnb', - 'eslint-config-airbnb-typescript', + 'airbnb-base', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', ), ), + ...airbnbTypescript, ...shared, { plugins: { @@ -47,7 +48,6 @@ export default [ '@typescript-eslint/prefer-string-starts-ends-with': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-misused-promises': [ 'error', { @@ -72,6 +72,33 @@ export default [ allowExpressions: true, }, ], + + // The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler + // Some of the rules also fail in TypeScript files, for example: https://github.com/typescript-eslint/typescript-eslint/issues/662#issuecomment-507081586 + // Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts + 'constructor-super': 'off', + 'getter-return': 'off', + 'no-const-assign': 'off', + 'no-dupe-args': 'off', + 'no-dupe-class-members': 'off', + 'no-dupe-keys': 'off', + 'no-func-assign': 'off', + 'no-import-assign': 'off', + 'no-new-symbol': 'off', + 'no-obj-calls': 'off', + 'no-redeclare': 'off', + 'no-setter-return': 'off', + 'no-this-before-super': 'off', + 'no-undef': 'off', + 'no-unreachable': 'off', + 'no-unsafe-negation': 'off', + 'valid-typeof': 'off', + // The following rules are enabled in Airbnb config, but are recommended to be disabled within TypeScript projects + // See: https://github.com/typescript-eslint/typescript-eslint/blob/13583e65f5973da2a7ae8384493c5e00014db51b/docs/linting/TROUBLESHOOTING.md#eslint-plugin-import + 'import/named': 'off', + 'import/no-named-as-default-member': 'off', + // Disable `import/no-unresolved`, see README.md for details + 'import/no-unresolved': 'off', }, }, ] diff --git a/packages/use-dataloader/src/__tests__/dataloader.test.ts b/packages/use-dataloader/src/__tests__/dataloader.test.ts index 90d24341b..6436c344d 100644 --- a/packages/use-dataloader/src/__tests__/dataloader.test.ts +++ b/packages/use-dataloader/src/__tests__/dataloader.test.ts @@ -14,6 +14,7 @@ const fakeNullPromise = () => new Promise(resolve => { setTimeout(() => resolve(null), PROMISE_TIMEOUT) }) + const fakeUndefinedPromise = () => new Promise(resolve => { setTimeout(() => resolve(undefined), PROMISE_TIMEOUT) @@ -196,6 +197,7 @@ describe('Dataloader class', () => { }), ) + // eslint-disable-next-line @typescript-eslint/await-thenable for await (const instance of instances) { await instance.load().catch(() => null) } diff --git a/packages/use-i18n/src/__tests__/formatDate.test.ts b/packages/use-i18n/src/__tests__/formatDate.test.ts index baadf92da..7fdd27b59 100644 --- a/packages/use-i18n/src/__tests__/formatDate.test.ts +++ b/packages/use-i18n/src/__tests__/formatDate.test.ts @@ -5,30 +5,30 @@ import formatDate, { supportedFormats } from '../formatDate' const locales = ['en', 'fr', 'de', 'ro', 'es'] const tests = [ - ...locales.map(locale => [ - ...supportedFormats.map(format => [ + ...locales.map(locale => + supportedFormats.map(format => [ format, 'new Date(2020, 1, 13, 16, 28)', locale, new Date(2020, 1, 13, 16, 28), ]), - ]), - ...locales.map(locale => [ - ...supportedFormats.map(format => [ + ), + ...locales.map(locale => + supportedFormats.map(format => [ format, '1581607680000', locale, 1581607680000, ]), - ]), - ...locales.map(locale => [ - ...supportedFormats.map(format => [ + ), + ...locales.map(locale => + supportedFormats.map(format => [ format, '2020-02-13T15:28:00.000Z', locale, '2020-02-13T15:28:00.000Z', ]), - ]), + ), ].flat() as [FormatDateOptions, string, string, Date | string | number][] describe('formatDate', () => { diff --git a/packages/use-i18n/src/__tests__/usei18n.test.tsx b/packages/use-i18n/src/__tests__/usei18n.test.tsx index d411cb1bc..acba656d4 100644 --- a/packages/use-i18n/src/__tests__/usei18n.test.tsx +++ b/packages/use-i18n/src/__tests__/usei18n.test.tsx @@ -53,7 +53,9 @@ const wrapper = return enGB }, + defaultLoad = async ({ locale }: { locale: string }) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-return import(`./locales/${locale}.ts`), defaultLocale = 'en', defaultTranslations = {}, @@ -152,7 +154,9 @@ describe('i18n hook', () => { }: { locale: string namespace: string - }) => import(`./locales/namespaces/${locale}/${namespace}.json`) + }) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + import(`./locales/namespaces/${locale}/${namespace}.json`) const { result } = renderHook( () => useTranslation(['user', 'profile'], load), @@ -208,7 +212,9 @@ describe('i18n hook', () => { }: { locale: string namespace: string - }) => import(`./locales/namespaces/${locale}/${namespace}.json`) + }) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + import(`./locales/namespaces/${locale}/${namespace}.json`) const { result } = renderHook( () => useTranslation(['user'], load), diff --git a/packages/use-i18n/src/formatUnit.ts b/packages/use-i18n/src/formatUnit.ts index bc6340137..1f3282b96 100644 --- a/packages/use-i18n/src/formatUnit.ts +++ b/packages/use-i18n/src/formatUnit.ts @@ -157,16 +157,18 @@ const format = ), output: 'object', round: maximumFractionDigits, - }) as unknown as { value: number; symbol: string; exponent: number } - computedValue = value.value + }) + + computedValue = Number.parseFloat(value.value) } else { const value = filesize(amount, { base, output: 'object', round: maximumFractionDigits, - }) as unknown as { value: number; symbol: string; exponent: number } + }) + computedExponent = exponents[value.exponent] - computedValue = value.value + computedValue = Number.parseFloat(value.value) } } diff --git a/packages/use-i18n/src/usei18n.tsx b/packages/use-i18n/src/usei18n.tsx index b31152c3a..e70256327 100644 --- a/packages/use-i18n/src/usei18n.tsx +++ b/packages/use-i18n/src/usei18n.tsx @@ -131,7 +131,7 @@ type Context< const I18nContext = createContext | undefined>(undefined) export function useI18n< - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type LocaleParam extends BaseLocale = {}, LocalSupportedType extends string = '', >(): RequiredGenericContext { @@ -147,7 +147,7 @@ export function useI18n< } export function useTranslation< - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type LocaleParam extends BaseLocale = {}, LocalSupportedType extends string = '', >( @@ -194,9 +194,11 @@ type LoadTranslationsFn = ({ type LoadLocaleFn = ( locale: LocalSupportedType, ) => DateFnsLocale + type LoadLocaleFnAsync = ( locale: LocalSupportedType, ) => Promise + type LoadDateLocaleError = (error: Error) => void const initialDefaultTranslations = {} diff --git a/packages/validate-icu-locales/src/index.ts b/packages/validate-icu-locales/src/index.ts index a8ed59bd8..a390ef873 100644 --- a/packages/validate-icu-locales/src/index.ts +++ b/packages/validate-icu-locales/src/index.ts @@ -51,6 +51,7 @@ const findICUErrors = ( const readFiles = async (files: string[]): Promise => { const errors = [] + // eslint-disable-next-line @typescript-eslint/await-thenable for await (const file of files) { const extension = file.split('.').pop() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d9f66f12..b0d5e1930 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: version: 7.26.0 '@babel/eslint-parser': specifier: 7.25.9 - version: 7.25.9(@babel/core@7.26.0)(eslint@9.13.0(jiti@1.21.6)) + version: 7.25.9(@babel/core@7.26.0)(eslint@9.16.0(jiti@1.21.6)) '@babel/plugin-transform-runtime': specifier: 7.25.9 version: 7.25.9(@babel/core@7.26.0) @@ -87,11 +87,11 @@ importers: specifier: 0.15.0 version: 0.15.0(browserslist@4.24.2)(esbuild@0.23.0) eslint: - specifier: 9.13.0 - version: 9.13.0(jiti@1.21.6) + specifier: 9.16.0 + version: 9.16.0(jiti@1.21.6) globals: - specifier: 15.12.0 - version: 15.12.0 + specifier: 15.13.0 + version: 15.13.0 happy-dom: specifier: 15.11.7 version: 15.11.7 @@ -144,9 +144,6 @@ importers: '@scaleway/use-segment': specifier: workspace:* version: link:../use-segment - '@types/cookie': - specifier: 0.6.0 - version: 0.6.0 react: specifier: 18.3.1 version: 18.3.1 @@ -162,18 +159,18 @@ importers: '@eslint/eslintrc': specifier: 3.2.0 version: 3.2.0 + '@stylistic/eslint-plugin': + specifier: 2.11.0 + version: 2.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) '@typescript-eslint/eslint-plugin': - specifier: 7.18.0 - version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + specifier: 8.16.0 + version: 8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) '@typescript-eslint/parser': - specifier: 7.18.0 - version: 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + specifier: 8.16.0 + version: 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) eslint-config-airbnb: specifier: 19.0.4 - version: 19.0.4(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-jsx-a11y@6.10.2(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react-hooks@5.0.0(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react@7.37.2(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) - eslint-config-airbnb-typescript: - specifier: 18.0.0 - version: 18.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) + version: 19.0.4(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-jsx-a11y@6.10.2(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react-hooks@5.0.0(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react@7.37.2(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) eslint-config-prettier: specifier: 9.1.0 version: 9.1.0(eslint@9.13.0(jiti@1.21.6)) @@ -185,7 +182,7 @@ importers: version: 3.2.0(eslint@9.13.0(jiti@1.21.6)) eslint-plugin-import: specifier: 2.31.0 - version: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) + version: 2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) eslint-plugin-jsx-a11y: specifier: 6.10.2 version: 6.10.2(eslint@9.13.0(jiti@1.21.6)) @@ -1394,6 +1391,10 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint/compat@1.2.3': resolution: {integrity: sha512-wlZhwlDFxkxIZ571aH0FoK4h4Vwx7P3HJx62Gp8hTc10bfpwT2x0nULuAHmQSJBOWPgPeVf+9YtnD4j50zVHmA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1407,10 +1408,18 @@ packages: resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.19.0': + resolution: {integrity: sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.7.0': resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.9.0': + resolution: {integrity: sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/eslintrc@3.2.0': resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1419,6 +1428,10 @@ packages: resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.16.0': + resolution: {integrity: sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1427,6 +1440,10 @@ packages: resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/plugin-kit@0.2.3': + resolution: {integrity: sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@formatjs/ecma402-abstract@2.2.4': resolution: {integrity: sha512-lFyiQDVvSbQOpU+WFd//ILolGj4UgA/qXrKeZxdV14uKiAUiPAtX6XAn7WBCRi7Mx6I7EybM9E5yYn4BIpZWYg==} @@ -1456,10 +1473,18 @@ packages: resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} engines: {node: '>=18.18.0'} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + '@humanfs/node@0.16.5': resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} engines: {node: '>=18.18.0'} + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + engines: {node: '>=18.18.0'} + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} @@ -1468,6 +1493,10 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} + '@humanwhocodes/retry@0.4.1': + resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} + engines: {node: '>=18.18'} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1660,6 +1689,12 @@ packages: resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} engines: {node: '>=18'} + '@stylistic/eslint-plugin@2.11.0': + resolution: {integrity: sha512-PNRHbydNG5EH8NK4c+izdJlxajIR6GxcUhzsYNRsn6Myep4dsZt0qFCz3rCPnkvgO5FYibDcMqgNHUT+zvjYZw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=8.40.0' + '@testing-library/dom@10.0.0': resolution: {integrity: sha512-PmJPnogldqoVFf+EwbHvbBJ98MmqASV8kLrBYgsDNxQcFMeIS7JFL48sfyXvuMtgmWO/wMhh25odr+8VhDmn4g==} engines: {node: '>=18'} @@ -1705,9 +1740,6 @@ packages: '@types/conventional-commits-parser@5.0.0': resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} - '@types/cookie@0.6.0': - resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -1762,22 +1794,22 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@7.18.0': - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/eslint-plugin@8.16.0': + resolution: {integrity: sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/parser@7.18.0': - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/parser@8.16.0': + resolution: {integrity: sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: @@ -1791,15 +1823,15 @@ packages: resolution: {integrity: sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.16.0': + resolution: {integrity: sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@7.18.0': - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/type-utils@8.16.0': + resolution: {integrity: sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: @@ -1813,9 +1845,9 @@ packages: resolution: {integrity: sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.16.0': + resolution: {integrity: sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@5.62.0': resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -1835,9 +1867,9 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@8.16.0': + resolution: {integrity: sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -1856,11 +1888,15 @@ packages: peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/utils@8.16.0': + resolution: {integrity: sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true '@typescript-eslint/visitor-keys@5.62.0': resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} @@ -1870,9 +1906,9 @@ packages: resolution: {integrity: sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@8.16.0': + resolution: {integrity: sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitejs/plugin-react@4.3.4': resolution: {integrity: sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==} @@ -1939,6 +1975,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -2483,13 +2524,6 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.2 - eslint-config-airbnb-typescript@18.0.0: - resolution: {integrity: sha512-oc+Lxzgzsu8FQyFVa4QFaVKiitTYiiW3frB9KYW5OWdPrqFc7FzxgB20hP4cHMlr+MBzGcLl3jnCOVOydL9mIg==} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^7.0.0 - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - eslint-config-airbnb@19.0.4: resolution: {integrity: sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==} engines: {node: ^10.12.0 || ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2578,6 +2612,10 @@ packages: resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-scope@8.2.0: + resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-visitor-keys@2.1.0: resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} engines: {node: '>=10'} @@ -2590,6 +2628,10 @@ packages: resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@9.13.0: resolution: {integrity: sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2600,10 +2642,24 @@ packages: jiti: optional: true + eslint@9.16.0: + resolution: {integrity: sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + espree@10.2.0: resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} @@ -2802,8 +2858,8 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@15.12.0: - resolution: {integrity: sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==} + globals@15.13.0: + resolution: {integrity: sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==} engines: {node: '>=18'} globalthis@1.0.3: @@ -3324,10 +3380,6 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -3579,6 +3631,10 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} @@ -4369,11 +4425,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.25.9(@babel/core@7.26.0)(eslint@9.13.0(jiti@1.21.6))': + '@babel/eslint-parser@7.25.9(@babel/core@7.26.0)(eslint@9.16.0(jiti@1.21.6))': dependencies: '@babel/core': 7.26.0 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 9.13.0(jiti@1.21.6) + eslint: 9.16.0(jiti@1.21.6) eslint-visitor-keys: 2.1.0 semver: 6.3.1 @@ -5561,8 +5617,15 @@ snapshots: eslint: 9.13.0(jiti@1.21.6) eslint-visitor-keys: 3.4.3 + '@eslint-community/eslint-utils@4.4.0(eslint@9.16.0(jiti@1.21.6))': + dependencies: + eslint: 9.16.0(jiti@1.21.6) + eslint-visitor-keys: 3.4.3 + '@eslint-community/regexpp@4.11.0': {} + '@eslint-community/regexpp@4.12.1': {} + '@eslint/compat@1.2.3(eslint@9.13.0(jiti@1.21.6))': optionalDependencies: eslint: 9.13.0(jiti@1.21.6) @@ -5575,8 +5638,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/config-array@0.19.0': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.7 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + '@eslint/core@0.7.0': {} + '@eslint/core@0.9.0': {} + '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 @@ -5593,12 +5666,18 @@ snapshots: '@eslint/js@9.13.0': {} + '@eslint/js@9.16.0': {} + '@eslint/object-schema@2.1.4': {} '@eslint/plugin-kit@0.2.0': dependencies: levn: 0.4.1 + '@eslint/plugin-kit@0.2.3': + dependencies: + levn: 0.4.1 + '@formatjs/ecma402-abstract@2.2.4': dependencies: '@formatjs/fast-memoize': 2.2.3 @@ -5635,15 +5714,24 @@ snapshots: '@humanfs/core@0.19.0': {} + '@humanfs/core@0.19.1': {} + '@humanfs/node@0.16.5': dependencies: '@humanfs/core': 0.19.0 '@humanwhocodes/retry': 0.3.1 + '@humanfs/node@0.16.6': + dependencies: + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.1': {} + '@humanwhocodes/retry@0.4.1': {} + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -5837,6 +5925,18 @@ snapshots: '@sindresorhus/merge-streams@2.3.0': {} + '@stylistic/eslint-plugin@2.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': + dependencies: + '@typescript-eslint/utils': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + eslint: 9.13.0(jiti@1.21.6) + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 + estraverse: 5.3.0 + picomatch: 4.0.2 + transitivePeerDependencies: + - supports-color + - typescript + '@testing-library/dom@10.0.0': dependencies: '@babel/code-frame': 7.26.0 @@ -5898,8 +5998,6 @@ snapshots: dependencies: '@types/node': 22.9.4 - '@types/cookie@0.6.0': {} - '@types/estree@1.0.5': {} '@types/estree@1.0.6': {} @@ -5952,14 +6050,14 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': + '@typescript-eslint/eslint-plugin@8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) - '@typescript-eslint/utils': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/parser': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/type-utils': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/utils': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.16.0 eslint: 9.13.0(jiti@1.21.6) graphemer: 1.4.0 ignore: 5.3.1 @@ -5970,13 +6068,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': + '@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.16.0 + debug: 4.3.7 eslint: 9.13.0(jiti@1.21.6) optionalDependencies: typescript: 5.7.2 @@ -5993,15 +6091,15 @@ snapshots: '@typescript-eslint/types': 7.12.0 '@typescript-eslint/visitor-keys': 7.12.0 - '@typescript-eslint/scope-manager@7.18.0': + '@typescript-eslint/scope-manager@8.16.0': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/visitor-keys': 8.16.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': + '@typescript-eslint/type-utils@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) - '@typescript-eslint/utils': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.2) + '@typescript-eslint/utils': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) debug: 4.3.7 eslint: 9.13.0(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.7.2) @@ -6014,7 +6112,7 @@ snapshots: '@typescript-eslint/types@7.12.0': {} - '@typescript-eslint/types@7.18.0': {} + '@typescript-eslint/types@8.16.0': {} '@typescript-eslint/typescript-estree@5.62.0(typescript@5.7.2)': dependencies: @@ -6045,12 +6143,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@8.16.0(typescript@5.7.2)': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/visitor-keys': 8.16.0 debug: 4.3.7 - globby: 11.1.0 + fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.3 @@ -6086,16 +6184,17 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': + '@typescript-eslint/utils@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.13.0(jiti@1.21.6)) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.2) eslint: 9.13.0(jiti@1.21.6) + optionalDependencies: + typescript: 5.7.2 transitivePeerDependencies: - supports-color - - typescript '@typescript-eslint/visitor-keys@5.62.0': dependencies: @@ -6107,10 +6206,10 @@ snapshots: '@typescript-eslint/types': 7.12.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.18.0': + '@typescript-eslint/visitor-keys@8.16.0': dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 + '@typescript-eslint/types': 8.16.0 + eslint-visitor-keys: 4.2.0 '@vitejs/plugin-react@4.3.4(vite@5.4.11(@types/node@22.9.4))': dependencies: @@ -6189,7 +6288,7 @@ snapshots: acorn-globals@7.0.1: dependencies: - acorn: 8.12.1 + acorn: 8.14.0 acorn-walk: 8.3.3 optional: true @@ -6197,13 +6296,19 @@ snapshots: dependencies: acorn: 8.12.1 + acorn-jsx@5.3.2(acorn@8.14.0): + dependencies: + acorn: 8.14.0 + acorn-walk@8.3.3: dependencies: - acorn: 8.12.1 + acorn: 8.14.0 optional: true acorn@8.12.1: {} + acorn@8.14.0: {} + agent-base@6.0.2: dependencies: debug: 4.3.7 @@ -6840,29 +6945,20 @@ snapshots: source-map: 0.6.1 optional: true - eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)): + eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)): dependencies: confusing-browser-globals: 1.0.11 eslint: 9.13.0(jiti@1.21.6) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) object.assign: 4.1.5 object.entries: 1.1.8 semver: 6.3.1 - eslint-config-airbnb-typescript@18.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)): - dependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) - '@typescript-eslint/parser': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) - eslint: 9.13.0(jiti@1.21.6) - eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) - transitivePeerDependencies: - - eslint-plugin-import - - eslint-config-airbnb@19.0.4(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-jsx-a11y@6.10.2(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react-hooks@5.0.0(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react@7.37.2(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)): + eslint-config-airbnb@19.0.4(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-jsx-a11y@6.10.2(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react-hooks@5.0.0(eslint@9.13.0(jiti@1.21.6)))(eslint-plugin-react@7.37.2(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)): dependencies: eslint: 9.13.0(jiti@1.21.6) - eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.13.0(jiti@1.21.6)) eslint-plugin-react: 7.37.2(eslint@9.13.0(jiti@1.21.6)) eslint-plugin-react-hooks: 5.0.0(eslint@9.13.0(jiti@1.21.6)) @@ -6881,11 +6977,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@9.13.0(jiti@1.21.6)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@9.13.0(jiti@1.21.6)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/parser': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) eslint: 9.13.0(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -6907,7 +7003,7 @@ snapshots: eslint: 9.13.0(jiti@1.21.6) ignore: 5.3.1 - eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.13.0(jiti@1.21.6)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -6918,7 +7014,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.13.0(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@9.13.0(jiti@1.21.6)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@9.13.0(jiti@1.21.6)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -6930,7 +7026,7 @@ snapshots: string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) + '@typescript-eslint/parser': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.7.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -6991,12 +7087,19 @@ snapshots: esrecurse: 4.3.0 estraverse: 5.3.0 + eslint-scope@8.2.0: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + eslint-visitor-keys@2.1.0: {} eslint-visitor-keys@3.4.3: {} eslint-visitor-keys@4.1.0: {} + eslint-visitor-keys@4.2.0: {} + eslint@9.13.0(jiti@1.21.6): dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.13.0(jiti@1.21.6)) @@ -7039,12 +7142,59 @@ snapshots: transitivePeerDependencies: - supports-color + eslint@9.16.0(jiti@1.21.6): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.16.0(jiti@1.21.6)) + '@eslint-community/regexpp': 4.12.1 + '@eslint/config-array': 0.19.0 + '@eslint/core': 0.9.0 + '@eslint/eslintrc': 3.2.0 + '@eslint/js': 9.16.0 + '@eslint/plugin-kit': 0.2.3 + '@humanfs/node': 0.16.6 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.1 + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.3.7 + escape-string-regexp: 4.0.0 + eslint-scope: 8.2.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + optionalDependencies: + jiti: 1.21.6 + transitivePeerDependencies: + - supports-color + espree@10.2.0: dependencies: acorn: 8.12.1 acorn-jsx: 5.3.2(acorn@8.12.1) eslint-visitor-keys: 4.1.0 + espree@10.3.0: + dependencies: + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 4.2.0 + esprima@4.0.1: {} esquery@1.6.0: @@ -7105,7 +7255,7 @@ snapshots: '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.7 + micromatch: 4.0.8 fast-json-stable-stringify@2.1.0: {} @@ -7258,7 +7408,7 @@ snapshots: globals@14.0.0: {} - globals@15.12.0: {} + globals@15.13.0: {} globalthis@1.0.3: dependencies: @@ -7630,7 +7780,7 @@ snapshots: jsdom@20.0.3: dependencies: abab: 2.0.6 - acorn: 8.12.1 + acorn: 8.14.0 acorn-globals: 7.0.1 cssom: 0.5.0 cssstyle: 2.3.0 @@ -7811,11 +7961,6 @@ snapshots: merge2@1.4.1: {} - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -8039,6 +8184,8 @@ snapshots: picomatch@2.3.1: {} + picomatch@4.0.2: {} + pidtree@0.6.0: {} pify@4.0.1: {} diff --git a/vite.config.ts b/vite.config.ts index bd9de84e7..3fc318fb5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,7 +2,8 @@ import react from '@vitejs/plugin-react' import browserslist from 'browserslist' import { resolveToEsbuildTarget } from 'esbuild-plugin-browserslist' import { readPackage } from 'read-pkg' -import { type UserConfig, defineConfig } from 'vitest/config' +import { defineConfig } from 'vitest/config' +import type { ViteUserConfig } from 'vitest/config' const pkg = await readPackage() @@ -15,7 +16,8 @@ const externalPkgs = [ const external = (id: string) => { const match = (dependency: string) => new RegExp(`^${dependency}`).test(id) const isExternal = externalPkgs.some(match) - const isBundled = pkg.bundleDependencies?.some(match) // alias of bundledDependencies package.json field array + // alias of bundledDependencies package.json field array + const isBundled = pkg.bundleDependencies?.some(match) return isExternal && !isBundled } @@ -29,7 +31,7 @@ const targets = resolveToEsbuildTarget( }, ) -export const defaultConfig: UserConfig = { +export const defaultConfig: ViteUserConfig = { build: { outDir: 'dist', target: [...targets, 'node20'],