From 950b11c15a3b4163d4473cc85fef7094c3a56311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Lafont?= Date: Mon, 10 Jun 2024 17:08:48 +0200 Subject: [PATCH] feat(eslint): migrate to eslint 9 --- .changeset/witty-coins-promise.md | 5 + .eslintignore | 7 - .eslintrc | 49 --- eslint.config.mjs | 109 ++++++ package.json | 6 +- .../__mocks__/simple-git.ts | 1 - packages/eslint-config-react/emotion.js | 15 - packages/eslint-config-react/emotion.mjs | 24 ++ packages/eslint-config-react/index.js | 6 - packages/eslint-config-react/index.mjs | 5 + packages/eslint-config-react/javascript.mjs | 28 ++ packages/eslint-config-react/package.json | 22 +- packages/eslint-config-react/shared.js | 128 ------- packages/eslint-config-react/shared.mjs | 135 +++++++ packages/eslint-config-react/typescript.js | 56 --- packages/eslint-config-react/typescript.mjs | 77 ++++ .../src/__tests__/useDataLoader.test.tsx | 4 +- packages/validate-icu-locales/vite.config.ts | 2 +- pnpm-lock.yaml | 346 +++++++++--------- tsconfig.json | 2 +- 20 files changed, 582 insertions(+), 445 deletions(-) create mode 100644 .changeset/witty-coins-promise.md delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs delete mode 100644 packages/eslint-config-react/emotion.js create mode 100644 packages/eslint-config-react/emotion.mjs delete mode 100644 packages/eslint-config-react/index.js create mode 100644 packages/eslint-config-react/index.mjs create mode 100644 packages/eslint-config-react/javascript.mjs delete mode 100644 packages/eslint-config-react/shared.js create mode 100644 packages/eslint-config-react/shared.mjs delete mode 100644 packages/eslint-config-react/typescript.js create mode 100644 packages/eslint-config-react/typescript.mjs diff --git a/.changeset/witty-coins-promise.md b/.changeset/witty-coins-promise.md new file mode 100644 index 000000000..fa0e75e74 --- /dev/null +++ b/.changeset/witty-coins-promise.md @@ -0,0 +1,5 @@ +--- +'@scaleway/eslint-config-react': major +--- + +Migrate to eslint9 diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index badeddf3e..000000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -# From .gitignore -node_modules/ -dist/ -build/ -__typetests__/ -packages_deprecated/ -coverage/ \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 853e054b7..000000000 --- a/.eslintrc +++ /dev/null @@ -1,49 +0,0 @@ -{ - "root": true, - "env": { - "browser": true - }, - "overrides": [ - { - "parser": "@babel/eslint-parser", - "files": ["*.js", "*.mjs"], - "extends": "@scaleway/react" - }, - { - "files": ["*.ts", "*.tsx"], - "parserOptions": { - "project": ["tsconfig.json"] - }, - "extends": ["@scaleway/react/typescript"] - }, - { - "files": [ - "packages/changesets-renovate/**/*.ts{x,}", - "packages/validate-icu-locales/**/*.ts{x,}", - "**/__tests__/**/*.ts{x,}" - ], - "parserOptions": { - "project": ["tsconfig.json"] - }, - "extends": ["@scaleway/react/typescript"], - "rules": { - "no-console": "off", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-floating-promises": "warn" - } - }, - { - "files": [ - "packages/jest-helpers/**/*.ts{x,}", - "**/__tests__/**/*.ts{x,}", - "vitest.setup.ts", - "*.config.ts" - ], - "rules": { - "import/no-extraneous-dependencies": "off", - "react/jsx-key": "off", - "import/no-relative-packages": "off" - } - } - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..87f5f02e8 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,109 @@ +import babelParser from "@babel/eslint-parser"; +import scw from "@scaleway/eslint-config-react/javascript"; +import scwTypescript from "@scaleway/eslint-config-react/typescript"; +import globals from "globals"; + +export default [ + { + ignores: [ + "**/node_modules/", + "**/dist/", + "**/build/", + "**/__typetests__/", + "**/packages_deprecated/", + "**/coverage/", + ], + }, + { + languageOptions: { + globals: { + ...globals.browser, + }, + }, + }, + ...scw.map((config) => ({ ...config, files: ["**/*.js"] })), + { + files: ["**/*.js"], + + languageOptions: { + parser: babelParser, + parserOptions: { + configFile: "./babel.config.json", + }, + }, + }, + ...scwTypescript.map((config) => ({ + ...config, + files: ["**/*.ts", "**/*.tsx"], + })), + + { + files: ["**/*.ts", "**/*.tsx"], + + languageOptions: { + ecmaVersion: 5, + sourceType: "script", + + parserOptions: { + 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"], + }, + }, + })), + ...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, + "no-console": "off", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-floating-promises": "warn", + }, + })), + + { + files: [ + "packages/jest-helpers/**/*.ts{x,}", + "**/__tests__/**/*.ts{x,}", + "**/vitest.setup.ts", + "**/*.config.ts", + "**/__mocks__/**/*.ts{x,}", + ], + + rules: { + "import/no-extraneous-dependencies": "off", + "react/jsx-key": "off", + "import/no-relative-packages": "off", + }, + }, +]; diff --git a/package.json b/package.json index 399e6e995..9a7760afe 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@changesets/cli": "2.27.5", "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", + "@eslint/eslintrc": "3.1.0", "@scaleway/eslint-config-react": "workspace:*", "@scaleway/tsconfig": "workspace:*", "@testing-library/jest-dom": "6.4.6", @@ -36,7 +37,8 @@ "builtin-modules": "4.0.0", "cross-env": "7.0.3", "esbuild-plugin-browserslist": "0.12.1", - "eslint": "8.57.0", + "eslint": "9.4.0", + "globals": "15.4.0", "happy-dom": "14.12.0", "husky": "9.0.11", "lint-staged": "15.2.5", @@ -51,7 +53,7 @@ "wait-for-expect": "3.0.2" }, "scripts": { - "lint": "eslint --ext js,ts,tsx --cache .", + "lint": "eslint --cache .", "lint:fix": "pnpm run lint --fix", "build": "pnpm recursive run build", "commit": "npx git-cz -a", diff --git a/packages/changesets-renovate/__mocks__/simple-git.ts b/packages/changesets-renovate/__mocks__/simple-git.ts index b5b51bedf..9de8f5aa2 100644 --- a/packages/changesets-renovate/__mocks__/simple-git.ts +++ b/packages/changesets-renovate/__mocks__/simple-git.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies import { vi } from 'vitest' export const defaultGitValues = { diff --git a/packages/eslint-config-react/emotion.js b/packages/eslint-config-react/emotion.js deleted file mode 100644 index fbddd6374..000000000 --- a/packages/eslint-config-react/emotion.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - plugins: ['@emotion'], - rules: { - 'react/no-unknown-property': [ - 'error', - { - ignore: ['css'], - }, - ], - '@emotion/import-from-emotion': 'error', - '@emotion/no-vanilla': 'error', - '@emotion/styled-import': 'error', - '@emotion/syntax-preference': ['error', 'string'], - }, -} diff --git a/packages/eslint-config-react/emotion.mjs b/packages/eslint-config-react/emotion.mjs new file mode 100644 index 000000000..9bb70e992 --- /dev/null +++ b/packages/eslint-config-react/emotion.mjs @@ -0,0 +1,24 @@ +import { rules } from '@emotion/eslint-plugin' +import { fixupPluginRules } from '@eslint/compat' + +export default [ + { + plugins: { + '@emotion': fixupPluginRules({ rules }), + }, + + rules: { + 'react/no-unknown-property': [ + 'error', + { + ignore: ['css'], + }, + ], + + '@emotion/import-from-emotion': 'error', + '@emotion/no-vanilla': 'error', + '@emotion/styled-import': 'error', + '@emotion/syntax-preference': ['error', 'string'], + }, + }, +] diff --git a/packages/eslint-config-react/index.js b/packages/eslint-config-react/index.js deleted file mode 100644 index 63ddce8b8..000000000 --- a/packages/eslint-config-react/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - extends: ['eslint-config-airbnb', require.resolve('./shared')], - rules: { - 'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], - }, -} diff --git a/packages/eslint-config-react/index.mjs b/packages/eslint-config-react/index.mjs new file mode 100644 index 000000000..ae7517dbe --- /dev/null +++ b/packages/eslint-config-react/index.mjs @@ -0,0 +1,5 @@ +import emotion from "./emotion.mjs"; +import javascript from "./javascript.mjs"; +import typescript from "./typescript.mjs"; + +export { emotion, javascript, typescript }; diff --git a/packages/eslint-config-react/javascript.mjs b/packages/eslint-config-react/javascript.mjs new file mode 100644 index 000000000..6c130c659 --- /dev/null +++ b/packages/eslint-config-react/javascript.mjs @@ -0,0 +1,28 @@ +import { fixupConfigRules } from "@eslint/compat"; +import { FlatCompat } from "@eslint/eslintrc"; +import airbnb from "eslint-config-airbnb"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import shared from "./shared.mjs"; + +const filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(filename); + +const compat = new FlatCompat({ + baseDirectory: dirname, +}); + +export default [ + ...fixupConfigRules(compat.config(airbnb)), + ...shared, + { + rules: { + "react/jsx-filename-extension": [ + "error", + { + extensions: [".js"], + }, + ], + }, + }, +]; diff --git a/packages/eslint-config-react/package.json b/packages/eslint-config-react/package.json index 2af6808bf..6ceee87f4 100644 --- a/packages/eslint-config-react/package.json +++ b/packages/eslint-config-react/package.json @@ -6,18 +6,34 @@ "eslint", "eslintconfig" ], - "main": "index.js", "publishConfig": { "access": "public" }, + "type": "module", "repository": { "type": "git", "url": "https://github.com/scaleway/scaleway-lib", "directory": "packages/eslint-config-react" }, + "exports": { + ".": "./index.mjs", + "./javascript": "./javascript.mjs", + "./typescript": "./typescript.mjs", + "./emotion": "./emotion.mjs", + "./shared": "./shared.mjs" + }, + "files": [ + "index.mjs", + "javascript.mjs", + "typescript.mjs", + "shared.mjs", + "emotion.mjs" + ], "license": "MIT", "dependencies": { "@emotion/eslint-plugin": "11.11.0", + "@eslint/compat": "1.0.3", + "@eslint/eslintrc": "3.1.0", "@typescript-eslint/eslint-plugin": "7.12.0", "@typescript-eslint/parser": "7.12.0", "eslint-config-airbnb": "19.0.4", @@ -31,10 +47,10 @@ "eslint-plugin-react-hooks": "4.6.2" }, "peerDependencies": { - "eslint": ">= 8.5" + "eslint": ">= 9.4" }, "devDependencies": { - "eslint": "8.57.0", + "eslint": "9.4.0", "typescript": "5.4.5" } } diff --git a/packages/eslint-config-react/shared.js b/packages/eslint-config-react/shared.js deleted file mode 100644 index e6b724242..000000000 --- a/packages/eslint-config-react/shared.js +++ /dev/null @@ -1,128 +0,0 @@ -module.exports = { - extends: [ - 'airbnb/hooks', - 'prettier', - 'plugin:eslint-comments/recommended', - 'plugin:react/jsx-runtime', - ], - rules: { - curly: 'error', - 'import/order': [ - // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md - 'error', - { - alphabetize: { - caseInsensitive: false, - order: 'asc', - }, - groups: [ - ['builtin', 'external'], - 'internal', - 'parent', - 'sibling', - 'index', - ], - 'newlines-between': 'never', - }, - ], - // Here we override airbnb default with our repos dev patterns - // https://github.com/airbnb/javascript/blob/81157eec2309449b31f36bf8940493623f2530c6/packages/eslint-config-airbnb-base/rules/imports.js#L71 - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: [ - '**/.jest/**', - '**/.storybook/**', - 'test/**', // tape, common npm pattern - 'tests/**', // also common npm pattern - 'spec/**', // mocha, rspec-like pattern - '**/__tests__/**', // jest pattern - '**/__mocks__/**', // jest pattern - '**/__stories__/**', // stories pattern - 'test.{js,jsx,ts,tsx}', // repos with a single test file - 'test-*.{js,jsx,ts,tsx}', // repos with multiple top-level test files - '**/*{.,_}{test,spec}.{js,jsx,ts,tsx}', // tests where the extension or filename suffix denotes that it is a test - '**/jest.config.{js,ts,mjs,mts}', // jest config - '**/jest.setup.{js,ts,mjs,mts}', // jest setup - '**/webpack.config.{js,ts,mjs,mts}', // webpack config - '**/webpack.config.*.{js,ts,mjs,mts}', // webpack config - '**/rollup.config.{js,ts,mjs,mts}', // rollup config - '**/rollup.config.*.{js,ts,mjs,mts}', // rollup config - ], - optionalDependencies: false, - }, - ], - // We allow named and default export - 'import/prefer-default-export': 'off', - // This allows us to reenable ForOfStatement. - // While this has been disabled in airbnb configuration it's native to the browsers we support - // so the original argument about weight is no up to date https://github.com/airbnb/javascript/issues/1271 - 'no-restricted-syntax': [ - // https://eslint.org/docs/rules/no-restricted-syntax#disallow-specified-syntax-no-restricted-syntax - 'error', - { - message: - 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.', - selector: 'ForInStatement', - }, - { - message: - 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.', - selector: 'LabeledStatement', - }, - { - message: - '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.', - selector: 'WithStatement', - }, - { - message: '`export *` is forbidden.', - selector: 'ExportAllDeclaration', - }, - ], - // This is to have a more breathable codebase - 'padding-line-between-statements': [ - // https://eslint.org/docs/rules/padding-line-between-statements - 'error', - { - blankLine: 'always', - next: 'return', - prev: '*', - }, - ], - // As we don't really care about the function type - 'react/function-component-definition': 'off', - - // These are rules soon to be enabled by airbnb react config - // We're getting a head start - 'react/no-adjacent-inline-elements': 'error', // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md - 'prefer-object-has-own': 'error', // https://eslint.org/docs/rules/prefer-object-has-own - - // Prevent uneeded rerender with object as default props - // https://github.com/jsx-eslint/eslint-plugin-react/blob/c8f2813758dea1759ba5ab8caf1920cae9417a43/docs/rules/no-object-type-as-default-prop.md - 'react/no-object-type-as-default-prop': 'error', - - // We don't use babel-preset-airbnb so we can make those changes - 'react/static-property-placement': ['error', 'static public field'], - 'react/state-in-constructor': ['error', 'never'], - - // To have consistent ordering in proptypes - 'react/sort-prop-types': [ - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md - 'error', - { ignoreCase: true, requiredFirst: false, sortShapeProp: true }, - ], - // Same but for imports - 'sort-imports': [ - // https://eslint.org/docs/rules/sort-imports - 'error', - { - ignoreDeclarationSort: true, - memberSyntaxSortOrder: ['single', 'multiple', 'all', 'none'], - }, - ], - 'sort-keys': 'off', - 'no-constant-binary-expression': 'error', - 'react/jsx-key': 'error', - }, -} diff --git a/packages/eslint-config-react/shared.mjs b/packages/eslint-config-react/shared.mjs new file mode 100644 index 000000000..3a8c2fb0a --- /dev/null +++ b/packages/eslint-config-react/shared.mjs @@ -0,0 +1,135 @@ +import { fixupConfigRules } 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, +}) + +export default [ + ...fixupConfigRules( + compat.extends( + 'airbnb/hooks', + 'prettier', + 'plugin:eslint-comments/recommended', + 'plugin:react/jsx-runtime', + ), + ), + { + rules: { + curly: 'error', + + 'import/order': [ + 'error', + { + alphabetize: { + caseInsensitive: false, + order: 'asc', + }, + + groups: [ + ['builtin', 'external'], + 'internal', + 'parent', + 'sibling', + 'index', + ], + 'newlines-between': 'never', + }, + ], + + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: [ + '**/.jest/**', + '**/.storybook/**', + 'test/**', + 'tests/**', + 'spec/**', + '**/__tests__/**', + '**/__mocks__/**', + '**/__stories__/**', + 'test.{js,jsx,ts,tsx}', + 'test-*.{js,jsx,ts,tsx}', + '**/*{.,_}{test,spec}.{js,jsx,ts,tsx}', + '**/jest.config.{js,ts,mjs,mts}', + '**/jest.setup.{js,ts,mjs,mts}', + '**/webpack.config.{js,ts,mjs,mts}', + '**/webpack.config.*.{js,ts,mjs,mts}', + '**/rollup.config.{js,ts,mjs,mts}', + '**/rollup.config.*.{js,ts,mjs,mts}', + ], + + optionalDependencies: false, + }, + ], + + 'import/prefer-default-export': 'off', + + 'no-restricted-syntax': [ + 'error', + { + message: + 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.', + selector: 'ForInStatement', + }, + { + message: + 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.', + selector: 'LabeledStatement', + }, + { + message: + '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.', + selector: 'WithStatement', + }, + { + message: '`export *` is forbidden.', + selector: 'ExportAllDeclaration', + }, + ], + + 'padding-line-between-statements': [ + 'error', + { + blankLine: 'always', + next: 'return', + prev: '*', + }, + ], + + 'react/function-component-definition': 'off', + 'react/no-adjacent-inline-elements': 'error', + 'prefer-object-has-own': 'error', + 'react/no-object-type-as-default-prop': 'error', + 'react/static-property-placement': ['error', 'static public field'], + 'react/state-in-constructor': ['error', 'never'], + + 'react/sort-prop-types': [ + 'error', + { + ignoreCase: true, + requiredFirst: false, + sortShapeProp: true, + }, + ], + + 'sort-imports': [ + 'error', + { + ignoreDeclarationSort: true, + memberSyntaxSortOrder: ['single', 'multiple', 'all', 'none'], + }, + ], + + 'sort-keys': 'off', + 'no-constant-binary-expression': 'error', + 'react/jsx-key': 'error', + }, + }, +] diff --git a/packages/eslint-config-react/typescript.js b/packages/eslint-config-react/typescript.js deleted file mode 100644 index f63a3f92b..000000000 --- a/packages/eslint-config-react/typescript.js +++ /dev/null @@ -1,56 +0,0 @@ -module.exports = { - extends: [ - 'eslint-config-airbnb', - 'eslint-config-airbnb-typescript', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - require.resolve('./shared'), - ], - plugins: ['deprecation', '@typescript-eslint'], - rules: { - // Enforce T[] instead of Array - '@typescript-eslint/array-type': [ - 'error', - { - default: 'array', - }, - ], - // Avoid toString which are going to generate [object Object] - '@typescript-eslint/no-base-to-string': 'error', - // (someCondition === true) => (someCondition) - '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', - '@typescript-eslint/no-unnecessary-condition': 'error', - '@typescript-eslint/no-unnecessary-type-arguments': 'error', - '@typescript-eslint/no-unsafe-declaration-merging': 'error', - '@typescript-eslint/prefer-for-of': 'error', - '@typescript-eslint/prefer-includes': 'error', - '@typescript-eslint/prefer-optional-chain': 'error', - '@typescript-eslint/prefer-reduce-type-parameter': 'error', - '@typescript-eslint/prefer-string-starts-ends-with': 'error', - '@typescript-eslint/prefer-ts-expect-error': 'error', - '@typescript-eslint/no-floating-promises': 'error', - // https://github.com/typescript-eslint/typescript-eslint/issues/4619 - '@typescript-eslint/no-misused-promises': [ - 'error', - { - checksVoidReturn: { - attributes: false, - }, - }, - ], - '@typescript-eslint/no-explicit-any': 'warn', - '@typescript-eslint/no-unused-vars': 'error', - '@typescript-eslint/consistent-type-imports': 'error', - '@typescript-eslint/consistent-type-exports': 'error', - '@typescript-eslint/consistent-type-definitions': ['error', 'type'], - '@typescript-eslint/no-redundant-type-constituents': 'warn', - // We favor object defaults instead of default props in TS - // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/default_props/#you-may-not-need-defaultprops - // https://twitter.com/dan_abramov/status/1133878326358171650 - 'react/require-default-props': 'off', - 'react/prop-types': 'off', - - // To allow <>{expression} - 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }], - }, -} diff --git a/packages/eslint-config-react/typescript.mjs b/packages/eslint-config-react/typescript.mjs new file mode 100644 index 000000000..308e867ec --- /dev/null +++ b/packages/eslint-config-react/typescript.mjs @@ -0,0 +1,77 @@ +import { fixupConfigRules } from '@eslint/compat' +import { FlatCompat } from '@eslint/eslintrc' +import deprecation from 'eslint-plugin-deprecation' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import shared from './shared.mjs' + +const filename = fileURLToPath(import.meta.url) +const dirname = path.dirname(filename) + +const compat = new FlatCompat({ + baseDirectory: dirname, +}) + +export default [ + ...fixupConfigRules( + compat.extends( + 'eslint-config-airbnb', + 'eslint-config-airbnb-typescript', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ), + ), + ...shared, + { + plugins: { + deprecation, + }, + + rules: { + '@typescript-eslint/array-type': [ + 'error', + { + default: 'array', + }, + ], + + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@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', + { + checksVoidReturn: { + attributes: false, + }, + }, + ], + + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-definitions': ['error', 'type'], + '@typescript-eslint/no-redundant-type-constituents': 'warn', + 'react/require-default-props': 'off', + 'react/prop-types': 'off', + + 'react/jsx-no-useless-fragment': [ + 'error', + { + allowExpressions: true, + }, + ], + }, + }, +] diff --git a/packages/use-dataloader/src/__tests__/useDataLoader.test.tsx b/packages/use-dataloader/src/__tests__/useDataLoader.test.tsx index fde31fa91..e71189b5f 100644 --- a/packages/use-dataloader/src/__tests__/useDataLoader.test.tsx +++ b/packages/use-dataloader/src/__tests__/useDataLoader.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { renderHook, waitFor } from '@testing-library/react' import type { ReactNode } from 'react' import { describe, expect, test, vi } from 'vitest' @@ -733,7 +732,7 @@ describe('useDataLoader', () => { { initialProps: { ...initialProps, - // eslint-disable-next-line no-sparse-arrays + key: ['test-13', false, testDate], method: fakePromise, }, @@ -895,4 +894,3 @@ describe('useDataLoader', () => { await waitFor(() => expect(result.current[1]?.isSuccess).toBe(true)) }) }) -/* eslint-enable no-console */ diff --git a/packages/validate-icu-locales/vite.config.ts b/packages/validate-icu-locales/vite.config.ts index 7cfa114ed..b901684d0 100644 --- a/packages/validate-icu-locales/vite.config.ts +++ b/packages/validate-icu-locales/vite.config.ts @@ -1,5 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ -/* eslint-disable import/no-relative-packages */ + import { defineConfig, mergeConfig } from 'vite' import { defaultConfig } from '../../vite.config' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6fdfafa5..d3e2342bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: version: 7.24.7 '@babel/eslint-parser': specifier: 7.24.7 - version: 7.24.7(@babel/core@7.24.7)(eslint@8.57.0) + version: 7.24.7(@babel/core@7.24.7)(eslint@9.4.0) '@babel/plugin-transform-runtime': specifier: 7.24.7 version: 7.24.7(@babel/core@7.24.7) @@ -41,6 +41,9 @@ importers: '@commitlint/config-conventional': specifier: 19.2.2 version: 19.2.2 + '@eslint/eslintrc': + specifier: 3.1.0 + version: 3.1.0 '@scaleway/eslint-config-react': specifier: workspace:* version: link:packages/eslint-config-react @@ -84,8 +87,11 @@ importers: specifier: 0.12.1 version: 0.12.1(browserslist@4.23.1)(esbuild@0.20.2) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 9.4.0 + version: 9.4.0 + globals: + specifier: 15.4.0 + version: 15.4.0 happy-dom: specifier: 14.12.0 version: 14.12.0 @@ -149,44 +155,50 @@ importers: dependencies: '@emotion/eslint-plugin': specifier: 11.11.0 - version: 11.11.0(eslint@8.57.0) + version: 11.11.0(eslint@9.4.0) + '@eslint/compat': + specifier: 1.0.3 + version: 1.0.3 + '@eslint/eslintrc': + specifier: 3.1.0 + version: 3.1.0 '@typescript-eslint/eslint-plugin': specifier: 7.12.0 - version: 7.12.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + version: 7.12.0(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5) '@typescript-eslint/parser': specifier: 7.12.0 - version: 7.12.0(eslint@8.57.0)(typescript@5.4.5) + version: 7.12.0(eslint@9.4.0)(typescript@5.4.5) eslint-config-airbnb: specifier: 19.0.4 - version: 19.0.4(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.57.0))(eslint-plugin-react@7.34.2(eslint@8.57.0))(eslint@8.57.0) + version: 19.0.4(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint-plugin-jsx-a11y@6.8.0(eslint@9.4.0))(eslint-plugin-react-hooks@4.6.2(eslint@9.4.0))(eslint-plugin-react@7.34.2(eslint@9.4.0))(eslint@9.4.0) eslint-config-airbnb-typescript: specifier: 18.0.0 - version: 18.0.0(@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) + version: 18.0.0(@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5))(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint@9.4.0) eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@8.57.0) + version: 9.1.0(eslint@9.4.0) eslint-plugin-deprecation: specifier: 2.0.0 - version: 2.0.0(eslint@8.57.0)(typescript@5.4.5) + version: 2.0.0(eslint@9.4.0)(typescript@5.4.5) eslint-plugin-eslint-comments: specifier: 3.2.0 - version: 3.2.0(eslint@8.57.0) + version: 3.2.0(eslint@9.4.0) eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0) eslint-plugin-jsx-a11y: specifier: 6.8.0 - version: 6.8.0(eslint@8.57.0) + version: 6.8.0(eslint@9.4.0) eslint-plugin-react: specifier: 7.34.2 - version: 7.34.2(eslint@8.57.0) + version: 7.34.2(eslint@9.4.0) eslint-plugin-react-hooks: specifier: 4.6.2 - version: 4.6.2(eslint@8.57.0) + version: 4.6.2(eslint@9.4.0) devDependencies: eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 9.4.0 + version: 9.4.0 typescript: specifier: 5.4.5 version: 5.4.5 @@ -1380,13 +1392,25 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/compat@1.0.3': + resolution: {integrity: sha512-9RaroPQaU2+SDcWav1YfuipwqnHccoiXZdUsicRQsQ/vH2wkEmRVcj344GapG/FnCeZRtqj0n6PshI+s9xkkAQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/config-array@0.15.1': + resolution: {integrity: sha512-K4gzNq+yymn/EVsXYmf+SBcBro8MTf+aXJZUphM96CdzUEr+ClGDvAbpmaEK+cGVigVXIgs9gNmvHAlrzzY5JQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.4.0': + resolution: {integrity: sha512-fdI7VJjP3Rvc70lC4xkFXHB0fiPeojiL1PxVG6t1ZvXQrarj893PweuBTujxDUFk0Fxj4R7PIIAZ/aiiyZPZcg==} + 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} '@formatjs/ecma402-abstract@2.0.0': resolution: {integrity: sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==} @@ -1413,18 +1437,13 @@ packages: resolution: {integrity: sha512-qfVhZcubsGjJI8oNjZp5g69N7c+NMxWl3WS05Sa93V6qNjE9Uz2PZqj7Qj+6iTEOZ1ignmEsIBJEKfdlpa9INg==} engines: {node: '>=10'} - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead - '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead + '@humanwhocodes/retry@0.3.0': + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + engines: {node: '>=18.18'} '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} @@ -2393,9 +2412,6 @@ packages: resolution: {integrity: sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@vitejs/plugin-react@4.3.1': resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -3001,10 +3017,6 @@ packages: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} @@ -3354,9 +3366,9 @@ packages: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-scope@8.0.1: + resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@2.1.0: resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} @@ -3366,14 +3378,18 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint@9.4.0: + resolution: {integrity: sha512-sjc7Y8cUD1IlwYcTS9qPSvGjAC8Ne9LctpxKKu3x/1IC9bnOg98Zy6GxEJUfr1NojMgVPlyANXYns8oE2c1TAA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + espree@10.0.1: + resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -3448,9 +3464,9 @@ packages: fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} filesize@10.1.2: resolution: {integrity: sha512-Dx770ai81ohflojxhU+oG+Z2QGvKdYxgEr9OSA8UVrqhwNHjfH9A8f5NKfg83fEH8ZFA5N5llJo5T3PIoZ4CRA==} @@ -3483,9 +3499,9 @@ packages: find-yarn-workspace-root2@1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} @@ -3583,9 +3599,13 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + globals@15.4.0: + resolution: {integrity: sha512-unnwvMZpv0eDUyjNyh9DH/yxUaRYrEjW/qK4QcdrHg3oO11igUQrCSgODHEqxlKg8v2CD2Sd7UkqqEBoz5U7TQ==} + engines: {node: '>=18'} globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -4805,11 +4825,6 @@ packages: rfdc@1.3.1: resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - rollup@4.14.3: resolution: {integrity: sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -5172,10 +5187,6 @@ packages: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -5546,11 +5557,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.24.7(@babel/core@7.24.7)(eslint@8.57.0)': + '@babel/eslint-parser@7.24.7(@babel/core@7.24.7)(eslint@9.4.0)': dependencies: '@babel/core': 7.24.7 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.57.0 + eslint: 9.4.0 eslint-visitor-keys: 2.1.0 semver: 6.3.1 @@ -6756,9 +6767,9 @@ snapshots: '@types/conventional-commits-parser': 5.0.0 chalk: 5.3.0 - '@emotion/eslint-plugin@11.11.0(eslint@8.57.0)': + '@emotion/eslint-plugin@11.11.0(eslint@9.4.0)': dependencies: - eslint: 8.57.0 + eslint: 9.4.0 '@esbuild/aix-ppc64@0.20.2': optional: true @@ -6835,19 +6846,29 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.4.0)': dependencies: - eslint: 8.57.0 + eslint: 9.4.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} - '@eslint/eslintrc@2.1.4': + '@eslint/compat@1.0.3': {} + + '@eslint/config-array@0.15.1': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.5 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.24.0 + debug: 4.3.5 + espree: 10.0.1 + globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -6856,7 +6877,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.0': {} + '@eslint/js@9.4.0': {} + + '@eslint/object-schema@2.1.4': {} '@formatjs/ecma402-abstract@2.0.0': dependencies: @@ -6891,17 +6914,9 @@ snapshots: dependencies: dom-mutator: 0.6.0 - '@humanwhocodes/config-array@0.11.14': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} + '@humanwhocodes/retry@0.3.0': {} '@istanbuljs/load-nyc-config@1.1.0': dependencies: @@ -8012,15 +8027,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.12.0(eslint@9.4.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 7.12.0 - '@typescript-eslint/type-utils': 7.12.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/type-utils': 7.12.0(eslint@9.4.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.12.0(eslint@9.4.0)(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.12.0 - eslint: 8.57.0 + eslint: 9.4.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -8030,14 +8045,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/scope-manager': 7.12.0 '@typescript-eslint/types': 7.12.0 '@typescript-eslint/typescript-estree': 7.12.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.12.0 debug: 4.3.4 - eslint: 8.57.0 + eslint: 9.4.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -8053,12 +8068,12 @@ snapshots: '@typescript-eslint/types': 7.12.0 '@typescript-eslint/visitor-keys': 7.12.0 - '@typescript-eslint/type-utils@7.12.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.12.0(eslint@9.4.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/typescript-estree': 7.12.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.12.0(eslint@9.4.0)(typescript@5.4.5) debug: 4.3.4 - eslint: 8.57.0 + eslint: 9.4.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 @@ -8099,27 +8114,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@6.21.0(eslint@9.4.0)(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - eslint: 8.57.0 + eslint: 9.4.0 semver: 7.6.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@7.12.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.12.0(eslint@9.4.0)(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) '@typescript-eslint/scope-manager': 7.12.0 '@typescript-eslint/types': 7.12.0 '@typescript-eslint/typescript-estree': 7.12.0(typescript@5.4.5) - eslint: 8.57.0 + eslint: 9.4.0 transitivePeerDependencies: - supports-color - typescript @@ -8134,8 +8149,6 @@ snapshots: '@typescript-eslint/types': 7.12.0 eslint-visitor-keys: 3.4.3 - '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-react@4.3.1(vite@5.2.13(@types/node@20.14.2))': dependencies: '@babel/core': 7.24.7 @@ -8833,10 +8846,6 @@ snapshots: dependencies: esutils: 2.0.3 - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - dom-accessibility-api@0.5.16: {} dom-accessibility-api@0.6.3: {} @@ -9126,38 +9135,38 @@ snapshots: source-map: 0.6.1 optional: true - eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0): + eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint@9.4.0): dependencies: confusing-browser-globals: 1.0.11 - eslint: 8.57.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) + eslint: 9.4.0 + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0) 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.12.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0): + eslint-config-airbnb-typescript@18.0.0(@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5))(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint@9.4.0): dependencies: - '@typescript-eslint/eslint-plugin': 7.12.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 - eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) + '@typescript-eslint/eslint-plugin': 7.12.0(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.12.0(eslint@9.4.0)(typescript@5.4.5) + eslint: 9.4.0 + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint@9.4.0) transitivePeerDependencies: - eslint-plugin-import - eslint-config-airbnb@19.0.4(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.57.0))(eslint-plugin-react@7.34.2(eslint@8.57.0))(eslint@8.57.0): + eslint-config-airbnb@19.0.4(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint-plugin-jsx-a11y@6.8.0(eslint@9.4.0))(eslint-plugin-react-hooks@4.6.2(eslint@9.4.0))(eslint-plugin-react@7.34.2(eslint@9.4.0))(eslint@9.4.0): dependencies: - eslint: 8.57.0 - eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) - eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) - eslint-plugin-react: 7.34.2(eslint@8.57.0) - eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) + eslint: 9.4.0 + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0))(eslint@9.4.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0) + eslint-plugin-jsx-a11y: 6.8.0(eslint@9.4.0) + eslint-plugin-react: 7.34.2(eslint@9.4.0) + eslint-plugin-react-hooks: 4.6.2(eslint@9.4.0) object.assign: 4.1.5 object.entries: 1.1.8 - eslint-config-prettier@9.1.0(eslint@8.57.0): + eslint-config-prettier@9.1.0(eslint@9.4.0): dependencies: - eslint: 8.57.0 + eslint: 9.4.0 eslint-import-resolver-node@0.3.9: dependencies: @@ -9167,33 +9176,33 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.4.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 + '@typescript-eslint/parser': 7.12.0(eslint@9.4.0)(typescript@5.4.5) + eslint: 9.4.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-deprecation@2.0.0(eslint@8.57.0)(typescript@5.4.5): + eslint-plugin-deprecation@2.0.0(eslint@9.4.0)(typescript@5.4.5): dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 + '@typescript-eslint/utils': 6.21.0(eslint@9.4.0)(typescript@5.4.5) + eslint: 9.4.0 tslib: 2.6.2 tsutils: 3.21.0(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - supports-color - eslint-plugin-eslint-comments@3.2.0(eslint@8.57.0): + eslint-plugin-eslint-comments@3.2.0(eslint@9.4.0): dependencies: escape-string-regexp: 1.0.5 - eslint: 8.57.0 + eslint: 9.4.0 ignore: 5.3.1 - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -9201,9 +9210,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.57.0 + eslint: 9.4.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.12.0(eslint@9.4.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.4.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -9214,13 +9223,13 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.12.0(eslint@9.4.0)(typescript@5.4.5) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): + eslint-plugin-jsx-a11y@6.8.0(eslint@9.4.0): dependencies: '@babel/runtime': 7.24.4 aria-query: 5.3.0 @@ -9232,7 +9241,7 @@ snapshots: damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 es-iterator-helpers: 1.0.18 - eslint: 8.57.0 + eslint: 9.4.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 @@ -9240,11 +9249,11 @@ snapshots: object.entries: 1.1.8 object.fromentries: 2.0.8 - eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): + eslint-plugin-react-hooks@4.6.2(eslint@9.4.0): dependencies: - eslint: 8.57.0 + eslint: 9.4.0 - eslint-plugin-react@7.34.2(eslint@8.57.0): + eslint-plugin-react@7.34.2(eslint@9.4.0): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 @@ -9253,7 +9262,7 @@ snapshots: array.prototype.tosorted: 1.1.3 doctrine: 2.1.0 es-iterator-helpers: 1.0.19 - eslint: 8.57.0 + eslint: 9.4.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -9271,7 +9280,7 @@ snapshots: esrecurse: 4.3.0 estraverse: 4.3.0 - eslint-scope@7.2.2: + eslint-scope@8.0.1: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -9280,38 +9289,36 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint@8.57.0: + eslint-visitor-keys@4.0.0: {} + + eslint@9.4.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint/config-array': 0.15.1 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.4.0 '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 + debug: 4.3.5 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.0.1 + eslint-visitor-keys: 4.0.0 + espree: 10.0.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 @@ -9323,11 +9330,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@9.6.1: + espree@10.0.1: dependencies: acorn: 8.11.3 acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 + eslint-visitor-keys: 4.0.0 esprima@4.0.1: {} @@ -9418,9 +9425,9 @@ snapshots: bser: 2.1.1 optional: true - file-entry-cache@6.0.1: + file-entry-cache@8.0.0: dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 filesize@10.1.2: {} @@ -9455,11 +9462,10 @@ snapshots: micromatch: 4.0.7 pkg-dir: 4.2.0 - flat-cache@3.2.0: + flat-cache@4.0.1: dependencies: flatted: 3.3.1 keyv: 4.5.4 - rimraf: 3.0.2 flatted@3.3.1: {} @@ -9561,9 +9567,9 @@ snapshots: globals@11.12.0: {} - globals@13.24.0: - dependencies: - type-fest: 0.20.2 + globals@14.0.0: {} + + globals@15.4.0: {} globalthis@1.0.3: dependencies: @@ -11005,10 +11011,6 @@ snapshots: rfdc@1.3.1: {} - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - rollup@4.14.3: dependencies: '@types/estree': 1.0.5 @@ -11397,8 +11399,6 @@ snapshots: type-fest@0.13.1: {} - type-fest@0.20.2: {} - type-fest@0.21.3: optional: true diff --git a/tsconfig.json b/tsconfig.json index 59a7dad39..9ec6f890c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "jsx": "preserve", "skipLibCheck": true }, - "include": ["**/*.ts", "**/*.js", "**/.*.js", "**/*.tsx"], + "include": ["**/*.ts", "**/*.js", "**/.*.js", "**/*.tsx", "**/*.mjs"], "exclude": [ "**/dist/*.ts", "**/__typetests__/*.test.ts",