From 7a3dca19ecdfee15f2df992a6fa4c537eb4a3d45 Mon Sep 17 00:00:00 2001 From: Brian Sokol Date: Wed, 1 May 2024 08:53:20 -0500 Subject: [PATCH] converting base files --- packages/eslint-plugin/eslint.config.mjs | 23 ++ packages/eslint-plugin/lib/config/core.ts | 290 +++++++++--------- packages/eslint-plugin/lib/config/jest.ts | 38 +-- packages/eslint-plugin/lib/config/jsx-a11y.ts | 61 ++-- packages/eslint-plugin/lib/config/mdx.ts | 20 +- packages/eslint-plugin/lib/config/react.ts | 156 +++++----- .../eslint-plugin/lib/config/storybook.ts | 47 ++- .../lib/config/testing-library.ts | 33 +- .../eslint-plugin/lib/config/typescript.ts | 140 ++++----- packages/eslint-plugin/lib/config/yaml.ts | 20 +- packages/eslint-plugin/lib/plugins.d.ts | 7 + packages/eslint-plugin/lib/utils/patterns.ts | 26 +- packages/eslint-plugin/package.json | 13 +- packages/eslint-plugin/tsconfig.json | 4 - packages/eslint-plugin/tsup.config.ts | 13 +- pnpm-lock.yaml | 254 ++++++++++++--- 16 files changed, 661 insertions(+), 484 deletions(-) create mode 100644 packages/eslint-plugin/eslint.config.mjs create mode 100644 packages/eslint-plugin/lib/plugins.d.ts diff --git a/packages/eslint-plugin/eslint.config.mjs b/packages/eslint-plugin/eslint.config.mjs new file mode 100644 index 00000000..6edb7c92 --- /dev/null +++ b/packages/eslint-plugin/eslint.config.mjs @@ -0,0 +1,23 @@ +import core from "./dist/core.mjs"; +import jest from "./dist/jest.mjs"; +import jsxA11y from "./dist/jsx-a11y.mjs"; +import mdx from "./dist/mdx.mjs"; +import react from "./dist/react.mjs"; +import storybook from "./dist/storybook.mjs"; +import testingLibrary from "./dist/testing-library.mjs"; +import yml from "./dist/yaml.mjs"; + +const config = [ + ...core, + jsxA11y, + mdx, + jest, + ...storybook, + ...react, + yml, + ...testingLibrary +]; + +// console.log(config); + +export default config; diff --git a/packages/eslint-plugin/lib/config/core.ts b/packages/eslint-plugin/lib/config/core.ts index 05f56e33..4cad06cc 100644 --- a/packages/eslint-plugin/lib/config/core.ts +++ b/packages/eslint-plugin/lib/config/core.ts @@ -1,158 +1,156 @@ +import js from "@eslint/js"; import type { Linter } from "eslint"; +import importPlugin from "eslint-plugin-import"; import { sourceFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: sourceFiles, - plugins: ["import"], - extends: [ - "eslint:recommended" - ], - parserOptions: { - sourceType: "module", - ecmaVersion: "latest" - }, - env: { - es2024: true, - node: true, - commonjs: true - }, - rules: { - // eslint:recommended overwrite some rules - "no-cond-assign": ["error", "except-parens"], - "no-labels": ["warn", { allowLoop: true, allowSwitch: false }], - "no-prototype-builtins": "off", +const config: Linter.FlatConfig[] = [ + { + files: sourceFiles, + rules: { + ...js.configs.recommended.rules, + // eslint:recommended overwrite some rules + "no-cond-assign": ["error", "except-parens"], + "no-labels": ["warn", { allowLoop: true, allowSwitch: false }], + "no-prototype-builtins": "off", - // https://eslint.org/docs/rules - // Extra eslint rules + // https://eslint.org/docs/rules + // Extra eslint rules - // Possible Problems - "array-callback-return": "error", - "no-self-compare": "error", - "no-template-curly-in-string": "error", - "no-use-before-define": [ - "error", - { - functions: false, - classes: false, - variables: false - } - ], + // Possible Problems + "array-callback-return": "error", + "no-self-compare": "error", + "no-template-curly-in-string": "error", + "no-use-before-define": [ + "error", + { + functions: false, + classes: false, + variables: false + } + ], - // Suggestions - "no-array-constructor": "warn", - "no-caller": "warn", - "no-eval": "warn", - "no-extend-native": "warn", - "no-extra-bind": "warn", - "no-extra-label": "warn", - "no-implied-eval": "warn", - "no-iterator": "warn", - "no-label-var": "warn", - "no-lone-blocks": "warn", - "no-loop-func": "warn", - "no-multi-str": "warn", - "no-new-func": "warn", - "no-new-object": "warn", - "no-new-wrappers": "warn", - "no-octal-escape": "warn", - "no-useless-computed-key": "warn", - "no-useless-concat": "warn", - "no-useless-constructor": "warn", - "no-script-url": "warn", - "no-sequences": "warn", - "no-throw-literal": "warn", - "prefer-const": "warn", - "no-var": "warn", - "curly": "warn", - "no-shadow": "warn", - "no-restricted-properties": "warn", - "no-unneeded-ternary": "warn", - "no-param-reassign": "warn", - "eqeqeq": ["warn", "smart"], - "no-mixed-operators": [ - "warn", - { - groups: [ - ["&", "|", "^", "~", "<<", ">>", ">>>"], - ["==", "!=", "===", "!==", ">", ">=", "<", "<="], - ["&&", "||"], - ["in", "instanceof"] - ], - allowSamePrecedence: false - } - ], - "no-restricted-syntax": ["error", "WithStatement"], - "no-restricted-globals": ["error"], - "no-useless-rename": [ - "warn", - { - ignoreDestructuring: false, - ignoreImport: false, - ignoreExport: false - } - ], - "strict": ["warn", "never"], - "no-unused-expressions": [ - "error", - { - allowShortCircuit: true, - allowTernary: true, - allowTaggedTemplates: true - } - ], + // Suggestions + "no-array-constructor": "warn", + "no-caller": "warn", + "no-eval": "warn", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-label": "warn", + "no-implied-eval": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-lone-blocks": "warn", + "no-loop-func": "warn", + "no-multi-str": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-wrappers": "warn", + "no-octal-escape": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-script-url": "warn", + "no-sequences": "warn", + "no-throw-literal": "warn", + "prefer-const": "warn", + "no-var": "warn", + "curly": "warn", + "no-shadow": "warn", + "no-restricted-properties": "warn", + "no-unneeded-ternary": "warn", + "no-param-reassign": "warn", + "eqeqeq": ["warn", "smart"], + "no-mixed-operators": [ + "warn", + { + groups: [ + ["&", "|", "^", "~", "<<", ">>", ">>>"], + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + allowSamePrecedence: false + } + ], + "no-restricted-syntax": ["error", "WithStatement"], + "no-restricted-globals": ["error"], + "no-useless-rename": [ + "warn", + { + ignoreDestructuring: false, + ignoreImport: false, + ignoreExport: false + } + ], + "strict": ["warn", "never"], + "no-unused-expressions": [ + "error", + { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true + } + ], - // Layout & Formatting - "no-native-reassign": "warn", // deprecated replaced by no-global-assign, deja ds recommended - "no-negated-in-lhs": "warn", // deprecated replaced by no-unsafe-negation, deja ds recommended - "padding-line-between-statements": [ - "warn", - { blankLine: "always", prev: "*", next: "return" } - ], + // Layout & Formatting + "no-native-reassign": "warn", // deprecated replaced by no-global-assign, deja ds recommended + "no-negated-in-lhs": "warn", // deprecated replaced by no-unsafe-negation, deja ds recommended + "padding-line-between-statements": [ + "warn", + { blankLine: "always", prev: "*", next: "return" } + ], - "rest-spread-spacing": ["warn", "never"], - "unicode-bom": ["warn", "never"], - "comma-spacing": ["warn", { "before": false, "after": true }], - "keyword-spacing": ["warn", { before: true, after: true }], - "arrow-spacing": ["warn", { before: true, after: true }], - "space-before-blocks": ["warn", "always"], - "space-in-parens": ["warn", "never"], - "padded-blocks": ["warn", "never"], - "brace-style":["warn", "1tbs", { "allowSingleLine": true }], - "new-parens": "warn", - "no-whitespace-before-property": "warn", - "no-multi-spaces": "warn", - "no-multiple-empty-lines": "warn", - "space-infix-ops": "warn", - "max-len": ["warn", { tabWidth: 4, code: 300 }], - "indent": [ - "warn", - 4, - { - SwitchCase: 1, - CallExpression: { arguments: "first" } - } - ], - "semi": ["warn", "always"], - "quotes": ["warn", "double"], - "comma-dangle": ["warn", "never"], - "object-curly-spacing": ["warn", "always"], - "dot-location": ["warn", "property"], - "arrow-parens": ["warn", "as-needed"], + "rest-spread-spacing": ["warn", "never"], + "unicode-bom": ["warn", "never"], + "comma-spacing": ["warn", { "before": false, "after": true }], + "keyword-spacing": ["warn", { before: true, after: true }], + "arrow-spacing": ["warn", { before: true, after: true }], + "space-before-blocks": ["warn", "always"], + "space-in-parens": ["warn", "never"], + "padded-blocks": ["warn", "never"], + "brace-style":["warn", "1tbs", { "allowSingleLine": true }], + "new-parens": "warn", + "no-whitespace-before-property": "warn", + "no-multi-spaces": "warn", + "no-multiple-empty-lines": "warn", + "space-infix-ops": "warn", + "max-len": ["warn", { tabWidth: 4, code: 300 }], + "indent": [ + "warn", + 4, + { + SwitchCase: 1, + CallExpression: { arguments: "first" } + } + ], + "semi": ["warn", "always"], + "quotes": ["warn", "double"], + "comma-dangle": ["warn", "never"], + "object-curly-spacing": ["warn", "always"], + "dot-location": ["warn", "property"], + "arrow-parens": ["warn", "as-needed"] - // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules - "import/no-amd": "error", - "import/no-webpack-loader-syntax": "error", - "import/no-self-import": "error", - "import/newline-after-import" : "warn", - "import/no-duplicates": "warn" + } + }, + { + files: sourceFiles, + plugins: { import: importPlugin }, + // These settings should be temporary until the import plugin is updated + // https://github.com/import-js/eslint-plugin-import/issues/2556 + settings: { + "import/parsers": { + espree: [".js", ".cjs", ".mjs", ".jsx"] } + }, + rules: { + // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules + "import/no-amd": "error", + "import/no-webpack-loader-syntax": "error", + "import/no-self-import": "error", + "import/newline-after-import" : "warn", + "import/no-duplicates": "warn" } - ] -}; + } +]; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/jest.ts b/packages/eslint-plugin/lib/config/jest.ts index 085f29d7..ca1927c4 100644 --- a/packages/eslint-plugin/lib/config/jest.ts +++ b/packages/eslint-plugin/lib/config/jest.ts @@ -1,31 +1,17 @@ +import jestPlugin from 'eslint-plugin-jest'; import { reactTestFiles, testFiles } from "../utils/patterns"; import type { Linter } from "eslint"; -const config: Linter.Config = { - overrides: [ - { - files: [...testFiles, ...reactTestFiles], - plugins: ["jest"], - env: { - es2024: true, - node: true, - browser: true, - commonjs: true, - jest: true - }, - extends: ["plugin:jest/recommended"], - rules: { - // Prefer spies to allow for automatic restoration - "jest/prefer-spy-on": "error", - // Gives better failure messages for array checks - "jest/prefer-to-contain": "error" - } - } - ] -}; +const config: Linter.FlatConfig = { + files: [...testFiles, ...reactTestFiles], + ...jestPlugin.configs['flat/recommended'], + rules: { + // Prefer spies to allow for automatic restoration + "jest/prefer-spy-on": "error", + // Gives better failure messages for array checks + "jest/prefer-to-contain": "error" + } +} -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/jsx-a11y.ts b/packages/eslint-plugin/lib/config/jsx-a11y.ts index 5b3bb377..0c4c20e7 100644 --- a/packages/eslint-plugin/lib/config/jsx-a11y.ts +++ b/packages/eslint-plugin/lib/config/jsx-a11y.ts @@ -1,42 +1,33 @@ import type { Linter } from "eslint"; +import jsxA11yPlugin from "eslint-plugin-jsx-a11y"; import { sourceFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: sourceFiles, - plugins: ["jsx-a11y"], - parserOptions: { - ecmaFeatures: { - jsx: true - } - }, - extends: [ - "plugin:jsx-a11y/recommended" - ], - rules: { - // There is a really good article that describes the issues with autoFocus and why it should be avoided: - // https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/ - // However, this issue is with screen readers and not with keyboard navigation. - // In Workleap, we use autoFocus in a lot of places to improve the user experience. - // Therefore, we are disabling this rule. - "jsx-a11y/no-autofocus": "off", +const config: Linter.FlatConfig = +{ + plugins: { "jsx-a11y": jsxA11yPlugin }, + languageOptions: { + parserOptions: jsxA11yPlugin.configs.recommended.parserOptions + }, + files: sourceFiles, + rules: { + ...jsxA11yPlugin.configs.recommended.rules, + // There is a really good article that describes the issues with autoFocus and why it should be avoided: + // https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/ + // However, this issue is with screen readers and not with keyboard navigation. + // In Workleap, we use autoFocus in a lot of places to improve the user experience. + // Therefore, we are disabling this rule. + "jsx-a11y/no-autofocus": "off", - // This rule ensures that all labels have an associated control that they are labeling. - // However, this rule causes a lot of false positive, since our current implementation of our company's design system - // does not use the "for" attribute in the label element and automatically add it inside Fields. - // Therefore, we are disabling this rule. - "jsx-a11y/label-has-associated-control:": "off", + // This rule ensures that all labels have an associated control that they are labeling. + // However, this rule causes a lot of false positive, since our current implementation of our company's design system + // does not use the "for" attribute in the label element and automatically add it inside Fields. + // Therefore, we are disabling this rule. + "jsx-a11y/label-has-associated-control:": "off", - // This rule ensures that all media elements have a for captions. - // Since we don't use captions, we are disabling this rule. - "jsx-a11y/media-has-caption": "off" - } - } - ] + // This rule ensures that all media elements have a for captions. + // Since we don't use captions, we are disabling this rule. + "jsx-a11y/media-has-caption": "off" + } }; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/mdx.ts b/packages/eslint-plugin/lib/config/mdx.ts index cd13bb8b..65a7757f 100644 --- a/packages/eslint-plugin/lib/config/mdx.ts +++ b/packages/eslint-plugin/lib/config/mdx.ts @@ -1,16 +1,12 @@ import type { Linter } from "eslint"; +import mdxPlugin from "eslint-plugin-mdx"; import { mdxFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: mdxFiles, - extends: ["plugin:mdx/recommended"] - } - ] -}; +const config: Linter.FlatConfig = + { + ...mdxPlugin.configs.flat, + files: mdxFiles + }; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; + +export default config; diff --git a/packages/eslint-plugin/lib/config/react.ts b/packages/eslint-plugin/lib/config/react.ts index bac348ba..732580fb 100644 --- a/packages/eslint-plugin/lib/config/react.ts +++ b/packages/eslint-plugin/lib/config/react.ts @@ -1,89 +1,89 @@ import type { Linter } from "eslint"; +import reactPlugin from 'eslint-plugin-react'; +import reactHooksPlugin from 'eslint-plugin-react-hooks'; +import globals from 'globals'; import { sourceFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: sourceFiles, - plugins: ["react", "react-hooks"], - extends: [ - "plugin:react/recommended", - "plugin:react-hooks/recommended" - ], - parserOptions: { - ecmaFeatures: { - jsx: true - } - }, - env: { - es2024: true, - node: true, - browser: true, - commonjs: true - }, - settings: { - react: { - version: "detect" - } +const config: Linter.FlatConfig[] = [ + { + files: sourceFiles, + plugins: { + react: reactPlugin + }, + settings: { + react: { + version: 'detect' + } + }, + languageOptions: { + ...reactPlugin.configs.recommended.languageOptions, + globals: { + ...globals.serviceworker, + ...globals.browser, }, - rules: { - // https://eslint.org/docs/rules - "jsx-quotes": ["warn", "prefer-double"], + }, + rules: { + ...reactPlugin.configs.recommended.rules, + // https://eslint.org/docs/rules + "jsx-quotes": ["warn", "prefer-double"], - // react/recommended overrides - "react/jsx-no-duplicate-props": ["warn", { ignoreCase: true }], - "react/jsx-no-undef": ["warn", { allowGlobals: true }], + // react/recommended overrides + "react/jsx-no-duplicate-props": ["warn", { ignoreCase: true }], + "react/jsx-no-undef": ["warn", { allowGlobals: true }], - // react/recommended disables - "react/react-in-jsx-scope": "off", - "react/display-name": "off", - "react/no-unescaped-entities": "off", - "react/prop-types": "off", - "react/jsx-key": "off", + // react/recommended disables + "react/react-in-jsx-scope": "off", + "react/display-name": "off", + "react/no-unescaped-entities": "off", + "react/prop-types": "off", + "react/jsx-key": "off", - // extra react rules - "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }], - "react/jsx-pascal-case": [ - "warn", - { - allowAllCaps: true, - ignore: [] - } - ], - "react/no-typos": "error", - "react/style-prop-object": "warn", - "react/button-has-type": "warn", - "react/destructuring-assignment": [ - "warn", - "always", - { ignoreClassFields: true } - ], - "react/jsx-boolean-value": ["warn", "never"], - "react/default-props-match-prop-types": "warn", - "react/no-unused-state": "warn", - "react/no-array-index-key": "warn", - "react/no-access-state-in-setstate": "warn", - "react/jsx-filename-extension": ["warn", { "extensions": [".jsx", ".tsx"] }], - "react/jsx-curly-brace-presence": "warn", - "react/no-unused-prop-types": [ - "warn", - { customValidators: [], skipShapeProps: true } - ], + // extra react rules + "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }], + "react/jsx-pascal-case": [ + "warn", + { + allowAllCaps: true, + ignore: [] + } + ], + "react/no-typos": "error", + "react/style-prop-object": "warn", + "react/button-has-type": "warn", + "react/destructuring-assignment": [ + "warn", + "always", + { ignoreClassFields: true } + ], + "react/jsx-boolean-value": ["warn", "never"], + "react/default-props-match-prop-types": "warn", + "react/no-unused-state": "warn", + "react/no-array-index-key": "warn", + "react/no-access-state-in-setstate": "warn", + "react/jsx-filename-extension": ["warn", { "extensions": [".jsx", ".tsx"] }], + "react/jsx-curly-brace-presence": "warn", + "react/no-unused-prop-types": [ + "warn", + { customValidators: [], skipShapeProps: true } + ], - "react/jsx-closing-bracket-location": [1, "line-aligned"], - "react/jsx-tag-spacing": ["warn", { beforeSelfClosing: "always" }], - "react/jsx-max-props-per-line": [ - "warn", - { maximum: 1, when: "multiline" } - ], - "react/jsx-curly-spacing": ["warn", { children: true, when: "never" }] + "react/jsx-closing-bracket-location": [1, "line-aligned"], + "react/jsx-tag-spacing": ["warn", { beforeSelfClosing: "always" }], + "react/jsx-max-props-per-line": [ + "warn", + { maximum: 1, when: "multiline" } + ], + "react/jsx-curly-spacing": ["warn", { children: true, when: "never" }] - } } - ] -}; + }, + { + ...reactHooksPlugin.configs.recommended, + plugins: { + "react-hooks": reactHooksPlugin + }, + files: sourceFiles, + } +]; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/storybook.ts b/packages/eslint-plugin/lib/config/storybook.ts index ac4b2199..1d33a57a 100644 --- a/packages/eslint-plugin/lib/config/storybook.ts +++ b/packages/eslint-plugin/lib/config/storybook.ts @@ -1,30 +1,29 @@ // https://github.com/storybookjs/eslint-plugin-storybook/blob/main/lib/configs/recommended.ts -import { mainStorybookFiles, storybookFiles } from "../utils/patterns"; - import type { Linter } from "eslint"; +import storybookPlugin from "eslint-plugin-storybook"; +import { mainStorybookFiles, storybookFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: storybookFiles, - plugins: ["storybook"], - extends: [ - "plugin:storybook/recommended", - "plugin:storybook/csf", - "plugin:storybook/csf-strict" - ] - }, - { - files: mainStorybookFiles, - rules: { - "storybook/no-uninstalled-addons": "warn" - } +const config: Linter.FlatConfig[] = [ + { + ignores: ['!.storybook'], + }, + { + files: storybookFiles, + plugins: { "storybook": storybookPlugin }, + rules: { + ...storybookPlugin.configs.recommended.overrides[0].rules, + ...storybookPlugin.configs.csf.overrides[0].rules, + ...storybookPlugin.configs['csf-strict'].rules, + } + }, + { + files: mainStorybookFiles, + plugins: { "storybook": storybookPlugin }, + rules: { + "storybook/no-uninstalled-addons": "warn" } - ] -}; + } +]; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/testing-library.ts b/packages/eslint-plugin/lib/config/testing-library.ts index 655ff90f..399897e3 100644 --- a/packages/eslint-plugin/lib/config/testing-library.ts +++ b/packages/eslint-plugin/lib/config/testing-library.ts @@ -1,22 +1,23 @@ +import testingLibraryPlugin from "eslint-plugin-testing-library"; import { reactTestFiles, testFiles } from "../utils/patterns"; import type { Linter } from "eslint"; -const config: Linter.Config = { - overrides: [ - { - files: reactTestFiles, - plugins: ["testing-library"], - extends: ["plugin:testing-library/react"] +const config: Linter.FlatConfig[] = [ + { + files: reactTestFiles, + plugins: { + "testing-library": testingLibraryPlugin }, - { - files: testFiles, - extends: ["plugin:testing-library/dom"] - } - ] -}; + rules: testingLibraryPlugin.configs.react.rules + }, + { + files: testFiles, + plugins: { + "testing-library": testingLibraryPlugin + }, + rules: testingLibraryPlugin.configs.dom.rules + } +]; -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/typescript.ts b/packages/eslint-plugin/lib/config/typescript.ts index 5944eeb1..87c11668 100644 --- a/packages/eslint-plugin/lib/config/typescript.ts +++ b/packages/eslint-plugin/lib/config/typescript.ts @@ -1,76 +1,76 @@ -import type { Linter } from "eslint"; +import tsEslint, { type Config } from "typescript-eslint"; import { typescriptFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: typescriptFiles, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - extends: [ - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - rules: { - // @typescript-eslint/recommended disables - "@typescript-eslint/no-non-null-assertion": "off", - - // additional rules we want - "@typescript-eslint/consistent-type-definitions": "warn", - "@typescript-eslint/explicit-member-accessibility": ["warn", { accessibility: "no-public" }], - "@typescript-eslint/method-signature-style": "warn", - "comma-dangle":"off", - "no-dupe-class-members":"off", - "@typescript-eslint/no-dupe-class-members":"error", - "no-loop-func":"off", - "@typescript-eslint/no-loop-func":"warn", - "no-shadow":"off", - "@typescript-eslint/no-shadow":"warn", - "no-unused-expressions":"off", - "@typescript-eslint/no-unused-expressions": [ - "error", - { - allowShortCircuit: true, - allowTernary: true, - allowTaggedTemplates: true - } - ], - "no-use-before-define":"off", - "no-useless-constructor":"off", - "@typescript-eslint/no-useless-constructor":"warn", - "object-curly-spacing":"off", - "quotes":"off", - "@typescript-eslint/quotes": ["warn", "double"], - "@typescript-eslint/no-import-type-side-effects": "warn", - "@typescript-eslint/consistent-type-imports": [ - "warn", - { - "prefer": "type-imports", - "disallowTypeAnnotations": true, - "fixStyle": "inline-type-imports" - } - ], +const unused = 3; - "@typescript-eslint/member-delimiter-style": "warn", - "@typescript-eslint/comma-dangle": ["warn", "never"], - "indent":"off", - "@typescript-eslint/indent": [ - "warn", - 4, - { - SwitchCase: 1, - CallExpression: { arguments: "first" } - } - ], - "@typescript-eslint/object-curly-spacing": ["warn", "always"], - "semi":"off", - "@typescript-eslint/semi": ["warn", "always"] +const config: Config = tsEslint.config( + { + files: typescriptFiles, + plugins: { + "@typescript-eslint": tsEslint.plugin + }, + languageOptions: { + parser: tsEslint.parser, + parserOptions: { + project: true } + }, + rules: { + // @typescript-eslint/recommended disables + "@typescript-eslint/no-non-null-assertion": "off", + + // additional rules we want + "@typescript-eslint/consistent-type-definitions": "warn", + "@typescript-eslint/explicit-member-accessibility": ["warn", { accessibility: "no-public" }], + "@typescript-eslint/method-signature-style": "warn", + "comma-dangle":"off", + "no-dupe-class-members":"off", + "@typescript-eslint/no-dupe-class-members":"error", + "no-loop-func":"off", + "@typescript-eslint/no-loop-func":"warn", + "no-shadow":"off", + "@typescript-eslint/no-shadow":"warn", + "no-unused-expressions":"off", + "@typescript-eslint/no-unused-expressions": [ + "error", + { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true + } + ], + "no-use-before-define":"off", + "no-useless-constructor":"off", + "@typescript-eslint/no-useless-constructor":"warn", + "object-curly-spacing":"off", + "quotes":"off", + "@typescript-eslint/quotes": ["warn", "double"], + "@typescript-eslint/no-import-type-side-effects": "warn", + "@typescript-eslint/consistent-type-imports": [ + "warn", + { + "prefer": "type-imports", + "disallowTypeAnnotations": true, + "fixStyle": "inline-type-imports" + } + ], + + "@typescript-eslint/member-delimiter-style": "warn", + "@typescript-eslint/comma-dangle": ["warn", "never"], + "indent":"off", + "@typescript-eslint/indent": [ + "warn", + 4, + { + SwitchCase: 1, + CallExpression: { arguments: "first" } + } + ], + "@typescript-eslint/object-curly-spacing": ["warn", "always"], + "semi":"off", + "@typescript-eslint/semi": ["warn", "always"] } - ] -}; + } +); -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/config/yaml.ts b/packages/eslint-plugin/lib/config/yaml.ts index 5d23506f..91e14b4b 100644 --- a/packages/eslint-plugin/lib/config/yaml.ts +++ b/packages/eslint-plugin/lib/config/yaml.ts @@ -1,18 +1,10 @@ import type { Linter } from "eslint"; +import ymlPlugin from 'eslint-plugin-yml'; import { yamlFiles } from "../utils/patterns"; -const config: Linter.Config = { - overrides: [ - { - files: yamlFiles, - plugins: ["yml"], - extends: ["plugin:yml/recommended"], - parser: "yaml-eslint-parser" - } - ] -}; +const config: Linter.FlatConfig = { + ...ymlPlugin.configs['flat/recommended'], + files: yamlFiles, +} -// Using TypeScript "export" keyword until ESLint support ESM. -// Otherwise we must deal with a weird CommonJS output from esbuild which is not worth it. -// For more info, see: https://github.com/evanw/esbuild/issues/1079 -export = config; +export default config; diff --git a/packages/eslint-plugin/lib/plugins.d.ts b/packages/eslint-plugin/lib/plugins.d.ts new file mode 100644 index 00000000..4bf2847d --- /dev/null +++ b/packages/eslint-plugin/lib/plugins.d.ts @@ -0,0 +1,7 @@ +declare module 'eslint-plugin-import'; +declare module 'eslint-plugin-jsx-a11y'; +declare module 'eslint-plugin-storybook'; +declare module 'eslint-plugin-jest'; +declare module 'eslint-plugin-react'; +declare module 'eslint-plugin-react-hooks'; +declare module 'eslint-plugin-testing-library'; diff --git a/packages/eslint-plugin/lib/utils/patterns.ts b/packages/eslint-plugin/lib/utils/patterns.ts index 69a88530..168ddd80 100644 --- a/packages/eslint-plugin/lib/utils/patterns.ts +++ b/packages/eslint-plugin/lib/utils/patterns.ts @@ -1,40 +1,40 @@ export const sourceFiles = [ - "*.[jt]s?(x)", - "*.[cm]js" + "**/*.[jt]s?(x)", + "**/*.[cm]js" ]; export const typescriptFiles = [ - "*.ts?(x)" + "**/*.ts?(x)" ]; export const testFiles = [ - "*.test.[jt]s", - "*-test.[jt]s", + "**/*.test.[jt]s", + "**/*-test.[jt]s", "**/__tests__/*.[jt]s", "**/test.[jt]s" ]; export const reactTestFiles = [ - "*.test.[jt]sx", - "*-test.[jt]sx", + "**/*.test.[jt]sx", + "**/*-test.[jt]sx", "**/__tests__/*.[jt]sx", "**/test.[jt]sx" ]; export const storybookFiles = [ - "*.(stories|storybook|story|chroma).[jt]s?(x)" + "**/*.(stories|storybook|story|chroma).[jt]s?(x)" ]; export const mainStorybookFiles = [ - ".storybook/main.@(js|cjs|mjs|ts)", - "storybook/main.@(js|cjs|mjs|ts)" + "**/*.storybook/main.@(js|cjs|mjs|ts)", + "**/storybook/main.@(js|cjs|mjs|ts)" ]; export const mdxFiles = [ - "*.mdx" + "**/*.mdx" ]; export const yamlFiles = [ - "*.yaml", - "*.yml" + "**/*.yaml", + "**/*.yml" ]; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 4625ec41..c86548df 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -36,7 +36,7 @@ }, "peerDependencies": { "@typescript-eslint/parser": "*", - "eslint": "*", + "eslint": "8.57.0", "typescript": "*" }, "peerDependenciesMeta": { @@ -55,6 +55,7 @@ "@swc/helpers": "0.5.9", "@swc/jest": "0.2.36", "@types/eslint": "8.56.9", + "@types/eslint__js": "^8.42.3", "@types/estree": "1.0.5", "@types/jest": "29.5.12", "@types/node": "20.12.7", @@ -67,18 +68,20 @@ "tsup": "8.0.2" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^7.6.0", + "@eslint/js": "^9.0.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^28.2.0", + "eslint-plugin-jest": "^28.3.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-mdx": "^3.1.5", "eslint-plugin-package-json": "^0.12.2", "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-storybook": "^0.8.0", - "eslint-plugin-testing-library": "^6.2.1", + "eslint-plugin-testing-library": "^6.2.2", "eslint-plugin-yml": "^1.14.0", + "globals": "^15.1.0", "jsonc-eslint-parser": "^2.4.0", + "typescript-eslint": "^7.8.0", "yaml-eslint-parser": "^1.2.2" }, "publishConfig": { diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index f2c76e4b..86749762 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "@workleap/typescript-configs/library", - "compilerOptions": { - "moduleResolution": "Node", - "module": "CommonJS" - }, "exclude": ["dist", "node_modules"] } diff --git a/packages/eslint-plugin/tsup.config.ts b/packages/eslint-plugin/tsup.config.ts index 4427fc50..14fb1c9d 100644 --- a/packages/eslint-plugin/tsup.config.ts +++ b/packages/eslint-plugin/tsup.config.ts @@ -1,7 +1,16 @@ import { defineBuildConfig } from "@workleap/tsup-configs"; export default defineBuildConfig({ - entry: ["./lib"], - format: "cjs", + entry: [ + "./lib/config/core.ts", + "./lib/config/mdx.ts", + "./lib/config/jsx-a11y.ts", + "./lib/config/storybook.ts", + "./lib/config/jest.ts", + "./lib/config/react.ts", + "./lib/config/yaml.ts", + "./lib/config/testing-library.ts" + ], + format: "esm", platform: "node" }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d84152e..3f8e46a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,18 +71,18 @@ importers: packages/eslint-plugin: dependencies: - '@typescript-eslint/eslint-plugin': - specifier: ^7.6.0 - version: 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) + '@eslint/js': + specifier: ^9.0.0 + version: 9.0.0 '@typescript-eslint/parser': specifier: '*' - version: 7.6.0(eslint@8.57.0)(typescript@5.4.5) + version: 7.7.0(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.7.0)(eslint@8.57.0) eslint-plugin-jest: - specifier: ^28.2.0 - version: 28.2.0(@typescript-eslint/eslint-plugin@7.6.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.4.5) + specifier: ^28.3.0 + version: 28.3.0(eslint@8.57.0)(jest@29.7.0)(typescript@5.4.5) eslint-plugin-jsx-a11y: specifier: ^6.8.0 version: 6.8.0(eslint@8.57.0) @@ -96,23 +96,29 @@ importers: specifier: ^7.34.1 version: 7.34.1(eslint@8.57.0) eslint-plugin-react-hooks: - specifier: ^4.6.0 - version: 4.6.0(eslint@8.57.0) + specifier: ^4.6.2 + version: 4.6.2(eslint@8.57.0) eslint-plugin-storybook: specifier: ^0.8.0 version: 0.8.0(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-testing-library: - specifier: ^6.2.1 - version: 6.2.1(eslint@8.57.0)(typescript@5.4.5) + specifier: ^6.2.2 + version: 6.2.2(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-yml: specifier: ^1.14.0 version: 1.14.0(eslint@8.57.0) + globals: + specifier: ^15.1.0 + version: 15.1.0 jsonc-eslint-parser: specifier: ^2.4.0 version: 2.4.0 typescript: specifier: '*' version: 5.4.5 + typescript-eslint: + specifier: ^7.8.0 + version: 7.8.0(eslint@8.57.0)(typescript@5.4.5) yaml-eslint-parser: specifier: ^1.2.2 version: 1.2.2 @@ -129,6 +135,9 @@ importers: '@types/eslint': specifier: 8.56.9 version: 8.56.9 + '@types/eslint__js': + specifier: ^8.42.3 + version: 8.42.3 '@types/estree': specifier: 1.0.5 version: 1.0.5 @@ -2779,6 +2788,11 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/js@9.0.0: + resolution: {integrity: sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: false + /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -4018,6 +4032,12 @@ packages: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 + /@types/eslint__js@8.42.3: + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + dependencies: + '@types/eslint': 8.56.9 + dev: true + /@types/estree-jsx@1.0.5: resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} dependencies: @@ -4277,8 +4297,8 @@ packages: dependencies: '@types/yargs-parser': 21.0.3 - /@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} + /@typescript-eslint/eslint-plugin@7.8.0(@typescript-eslint/parser@7.8.0)(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -4289,11 +4309,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 + '@typescript-eslint/parser': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.8.0 + '@typescript-eslint/type-utils': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.8.0 debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 graphemer: 1.4.0 @@ -4325,6 +4345,49 @@ packages: typescript: 5.4.5 transitivePeerDependencies: - supports-color + dev: true + + /@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.7.0 + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.7.0 + debug: 4.3.4(supports-color@5.5.0) + eslint: 8.57.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/parser@7.8.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.8.0 + '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.8.0 + debug: 4.3.4(supports-color@5.5.0) + eslint: 8.57.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: false /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -4348,9 +4411,26 @@ packages: dependencies: '@typescript-eslint/types': 7.6.0 '@typescript-eslint/visitor-keys': 7.6.0 + dev: true + + /@typescript-eslint/scope-manager@7.7.0: + resolution: {integrity: sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/visitor-keys': 7.7.0 + dev: false - /@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==} + /@typescript-eslint/scope-manager@7.8.0: + resolution: {integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/visitor-keys': 7.8.0 + dev: false + + /@typescript-eslint/type-utils@7.8.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -4359,8 +4439,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.8.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -4382,6 +4462,17 @@ packages: /@typescript-eslint/types@7.6.0: resolution: {integrity: sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==} engines: {node: ^18.18.0 || >=20.0.0} + dev: true + + /@typescript-eslint/types@7.7.0: + resolution: {integrity: sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: false + + /@typescript-eslint/types@7.8.0: + resolution: {integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: false /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -4446,6 +4537,51 @@ packages: typescript: 5.4.5 transitivePeerDependencies: - supports-color + dev: true + + /@typescript-eslint/typescript-estree@7.7.0(typescript@5.4.5): + resolution: {integrity: sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/visitor-keys': 7.7.0 + debug: 4.3.4(supports-color@5.5.0) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.4 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5): + resolution: {integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/visitor-keys': 7.8.0 + debug: 4.3.4(supports-color@5.5.0) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.4 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: false /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -4486,8 +4622,8 @@ packages: - typescript dev: false - /@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==} + /@typescript-eslint/utils@7.8.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -4495,9 +4631,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.8.0 + '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -4527,6 +4663,23 @@ packages: dependencies: '@typescript-eslint/types': 7.6.0 eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@7.7.0: + resolution: {integrity: sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.7.0 + eslint-visitor-keys: 3.4.3 + dev: false + + /@typescript-eslint/visitor-keys@7.8.0: + resolution: {integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.8.0 + eslint-visitor-keys: 3.4.3 + dev: false /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -6512,7 +6665,7 @@ packages: - supports-color dev: false - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -6533,7 +6686,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.7.0(eslint@8.57.0)(typescript@5.4.5) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -6541,7 +6694,7 @@ packages: - supports-color dev: false - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.7.0)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -6551,7 +6704,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.7.0(eslint@8.57.0)(typescript@5.4.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -6560,7 +6713,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.7.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -6576,8 +6729,8 @@ packages: - supports-color dev: false - /eslint-plugin-jest@28.2.0(@typescript-eslint/eslint-plugin@7.6.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.4.5): - resolution: {integrity: sha512-yRDti/a+f+SMSmNTiT9/M/MzXGkitl8CfzUxnpoQcTyfq8gUrXMriVcWU36W1X6BZSUoyUCJrDAWWUA2N4hE5g==} + /eslint-plugin-jest@28.3.0(eslint@8.57.0)(jest@29.7.0)(typescript@5.4.5): + resolution: {integrity: sha512-5LjCSSno8E+IUCOX4hJiIb/upPIgpkaDEcaN/40gOcw26t/5UTLHFc4JdxKjOOvGTh0XdCu+fNr0fpOVNvcxMA==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.0.0 || ^7.0.0 @@ -6589,7 +6742,6 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 jest: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2) @@ -6669,8 +6821,8 @@ packages: validate-npm-package-name: 5.0.0 dev: false - /eslint-plugin-react-hooks@4.6.0(eslint@8.57.0): - resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + /eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): + resolution: {integrity: sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 @@ -6721,8 +6873,8 @@ packages: - typescript dev: false - /eslint-plugin-testing-library@6.2.1(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-CP2YV/AxtgyrXgizM4648UkuVrFGDcCA8uDmrLytGqtsa7wgC6MTuIQqEAT1Qm4/zCxnC8xRtiGgfEwEt6hmdw==} + /eslint-plugin-testing-library@6.2.2(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-1E94YOTUDnOjSLyvOwmbVDzQi/WkKm3WVrMXu6SmBr6DN95xTGZmI6HJ/eOkSXh/DlheRsxaPsJvZByDBhWLVQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 @@ -7330,6 +7482,11 @@ packages: dependencies: type-fest: 0.20.2 + /globals@15.1.0: + resolution: {integrity: sha512-926gJqg+4mkxwYKiFvoomM4J0kWESfk3qfTvRL2/oc/tK/eTDBbrfcKnSa2KtfdxB5onoL7D3A3qIHQFpd4+UA==} + engines: {node: '>=18'} + dev: false + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -12453,6 +12610,25 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: false + /typescript-eslint@7.8.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-sheFG+/D8N/L7gC3WT0Q8sB97Nm573Yfr+vZFzl/4nBdYcmviBPtwGSX9TJ7wpVg28ocerKVOt+k2eGmHzcgVA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.8.0(@typescript-eslint/parser@7.8.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: false + /typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'}