diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index c6d8ea7dd..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": ["next/core-web-vitals", "next/typescript"], - "rules": { - "@typescript-eslint/no-unused-vars": [ - "error", - { "ignoreRestSiblings": true } - ], - "@typescript-eslint/no-empty-function": ["warn"], - "@typescript-eslint/no-empty-interface": [ - "error", - { "allowSingleExtends": false } - ], - "@typescript-eslint/no-empty-object-type": ["warn"], - "curly": ["warn", "all"], - "@typescript-eslint/no-unused-expressions": [ - "error", - { "allowTernary": true, "enforceForJSX": true } - ] - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..0776570c5 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,46 @@ +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default [ + ...compat.extends('next/core-web-vitals', 'next/typescript'), + { + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + }, + ], + + '@typescript-eslint/no-empty-function': ['warn', {}], + + '@typescript-eslint/no-empty-interface': [ + 'error', + { + allowSingleExtends: false, + }, + ], + + '@typescript-eslint/no-empty-object-type': ['warn'], + curly: ['warn', 'all'], + + '@typescript-eslint/no-unused-expressions': [ + 'error', + { + allowTernary: true, + enforceForJSX: true, + }, + ], + }, + }, +]; diff --git a/package.json b/package.json index 55a47294d..f1a01fb10 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,6 @@ "@storybook/testing-react": "^2.0.1", "@tanstack/react-query": "^4.29.17", "@tanstack/react-table": "^8.9.2", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react-hooks": "^7.0.2", - "@types/diff": "^5.0.3", "@xstate/fsm": "^2.0.0", "@xstate/inspect": "^0.7.1", "@xstate/react": "^3.2.2", @@ -108,6 +105,8 @@ }, "devDependencies": { "@chakra-ui/storybook-addon": "^5.0.1", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.17.0", "@faker-js/faker": "^6.0.0", "@mswjs/interceptors": "^0.19.0", "@playwright/browser-chromium": "^1.39.0", @@ -126,6 +125,7 @@ "@testing-library/dom": "^8.19.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^14.4.3", "@total-typescript/ts-reset": "^0.4.2", "@types/cookie-parser": "^1.4.3", @@ -133,8 +133,10 @@ "@types/d3": "^7.4.0", "@types/d3-cloud": "^1.2.5", "@types/d3-scale": "^4.0.3", + "@types/diff": "^5.0.3", "@types/dompurify": "^2.3.3", "@types/escape-html": "^1.0.2", + "@types/eslint__eslintrc": "^2.1.2", "@types/file-saver": "^2.0.5", "@types/he": "^1.1.2", "@types/http-proxy": "^1.17.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a06d156f..75554ccef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,15 +89,6 @@ importers: '@tanstack/react-table': specifier: ^8.9.2 version: 8.9.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@testing-library/jest-dom': - specifier: ^5.16.5 - version: 5.16.5 - '@testing-library/react-hooks': - specifier: ^7.0.2 - version: 7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@types/diff': - specifier: ^5.0.3 - version: 5.0.3 '@xstate/fsm': specifier: ^2.0.0 version: 2.0.0 @@ -255,6 +246,12 @@ importers: '@chakra-ui/storybook-addon': specifier: ^5.0.1 version: 5.0.1(@chakra-ui/react@2.4.6(@emotion/react@11.8.2(@babel/core@7.22.10)(@types/react@17.0.43)(react@18.3.1))(@emotion/styled@11.10.5(@babel/core@7.22.10)(@emotion/react@11.8.2(@babel/core@7.22.10)(@types/react@17.0.43)(react@18.3.1))(@types/react@17.0.43)(react@18.3.1))(@types/react@17.0.43)(framer-motion@6.5.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@storybook/components@7.5.3(@types/react-dom@18.3.1)(@types/react@17.0.43)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@storybook/manager-api@8.3.6(storybook@7.5.3))(@storybook/preview-api@8.3.6(storybook@7.5.3))(@storybook/types@8.3.6(storybook@7.5.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@eslint/eslintrc': + specifier: ^3.2.0 + version: 3.2.0 + '@eslint/js': + specifier: ^9.17.0 + version: 9.17.0 '@faker-js/faker': specifier: ^6.0.0 version: 6.0.0 @@ -303,9 +300,15 @@ importers: '@testing-library/dom': specifier: ^8.19.0 version: 8.19.0 + '@testing-library/jest-dom': + specifier: ^5.16.5 + version: 5.16.5 '@testing-library/react': specifier: ^13.4.0 version: 13.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@testing-library/react-hooks': + specifier: ^7.0.2 + version: 7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': specifier: ^14.4.3 version: 14.4.3(@testing-library/dom@8.19.0) @@ -327,12 +330,18 @@ importers: '@types/d3-scale': specifier: ^4.0.3 version: 4.0.3 + '@types/diff': + specifier: ^5.0.3 + version: 5.0.3 '@types/dompurify': specifier: ^2.3.3 version: 2.3.3 '@types/escape-html': specifier: ^1.0.2 version: 1.0.2 + '@types/eslint__eslintrc': + specifier: ^2.1.2 + version: 2.1.2 '@types/file-saver': specifier: ^2.0.5 version: 2.0.5 @@ -2620,14 +2629,18 @@ packages: resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + '@eslint/eslintrc@3.2.0': + resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@9.13.0': resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.17.0': + resolution: {integrity: sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==} + 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} @@ -4653,6 +4666,12 @@ packages: '@types/escodegen@0.0.6': resolution: {integrity: sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig==} + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/eslint__eslintrc@2.1.2': + resolution: {integrity: sha512-qXvzPFY7Rz05xD8ZApXJ3S8xStQD2Ibzu3EFIF0UMNOAfLY5xUu3H61q0JrHo2OXD6rcFG75yUxNQbkKtFKBSw==} + '@types/estree@0.0.51': resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} @@ -13125,13 +13144,13 @@ snapshots: '@eslint/core@0.7.0': {} - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 debug: 4.3.7 espree: 10.2.0 globals: 14.0.0 - ignore: 5.3.0 + ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -13141,6 +13160,8 @@ snapshots: '@eslint/js@9.13.0': {} + '@eslint/js@9.17.0': {} + '@eslint/object-schema@2.1.4': {} '@eslint/plugin-kit@0.2.1': @@ -15936,6 +15957,15 @@ snapshots: '@types/escodegen@0.0.6': {} + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + + '@types/eslint__eslintrc@2.1.2': + dependencies: + '@types/eslint': 9.6.1 + '@types/estree@0.0.51': {} '@types/estree@1.0.5': {} @@ -18265,7 +18295,7 @@ snapshots: debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 9.13.0(jiti@1.19.1) - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.19.1)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.19.1)))(eslint@9.13.0(jiti@1.19.1)) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 @@ -18278,7 +18308,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.19.1)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.19.1)))(eslint@9.13.0(jiti@1.19.1)): dependencies: debug: 3.2.7 optionalDependencies: @@ -18300,7 +18330,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.13.0(jiti@1.19.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.19.1)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.19.1))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.19.1)))(eslint@9.13.0(jiti@1.19.1)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -18384,7 +18414,7 @@ snapshots: '@eslint-community/regexpp': 4.11.1 '@eslint/config-array': 0.18.0 '@eslint/core': 0.7.0 - '@eslint/eslintrc': 3.1.0 + '@eslint/eslintrc': 3.2.0 '@eslint/js': 9.13.0 '@eslint/plugin-kit': 0.2.1 '@humanfs/node': 0.16.5