diff --git a/eslint.config.mjs b/eslint.config.mjs index be4118fe..49d68cd5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,7 @@ import sveltePlugin from 'eslint-plugin-svelte'; import pluginImportX from 'eslint-plugin-import-x'; import playwright from 'eslint-plugin-playwright'; import vitest from 'eslint-plugin-vitest'; +import storybook from 'eslint-plugin-storybook'; // Parsers const { parser: tsParser } = tseslint; @@ -165,6 +166,12 @@ const RULES = { // import-x: 'import-x/no-named-as-default-member': 'off' + }, + storybook: { + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + 'import-x/no-anonymous-default-export': 'off' } }; @@ -417,6 +424,23 @@ export default tseslint.config( ...vitest.environments.env.globals } } - } + }, /**/ + + ...patchFilesPrefix(storybook.configs['flat/recommended']), + // storybook sets files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'], + { + // Storybook Overrides + name: 'config-storybook', + // storybook.configs['flat/recommended'][0] - setup, [1] - *.stories.*ts/*js/tsx/jsx, [2] - .storybook/main.*js/*ts + files: arrayFilePathsDeprefix(storybook.configs['flat/recommended'][1], 'files', '*.', '**/*.'), + // files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'], + rules: { + ...RULES.ts, + // ...storybook.configs['flat/recommended'][0].rules, + ...storybook.configs['flat/recommended'][1].rules, + // ...storybook.configs['flat/recommended'][2].rules, + ...RULES.storybook + } + } ); diff --git a/package.json b/package.json index f7a9bce6..449b3f82 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import-x": "^3.0.1", "eslint-plugin-playwright": "^1.6.2", - "eslint-plugin-storybook": "^0.8.0", + "eslint-plugin-storybook": "0.9.0--canary.156.ed236ca.0", "eslint-plugin-svelte": "^2.36.0", "eslint-plugin-vitest": "^0.5.4", "glob": "^10.3.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c06680e..b3f1d023 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -193,8 +193,8 @@ importers: specifier: ^1.6.2 version: 1.6.2(eslint@9.7.0) eslint-plugin-storybook: - specifier: ^0.8.0 - version: 0.8.0(eslint@9.7.0)(typescript@5.3.3) + specifier: 0.9.0--canary.156.ed236ca.0 + version: 0.9.0--canary.156.ed236ca.0(eslint@9.7.0)(typescript@5.3.3) eslint-plugin-svelte: specifier: ^2.36.0 version: 2.42.0(eslint@9.7.0)(svelte@5.0.0-next.41)(ts-node@10.9.2(@types/node@20.11.17)(typescript@5.3.3)) @@ -2259,10 +2259,6 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@5.62.0': - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/scope-manager@7.0.1': resolution: {integrity: sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2294,10 +2290,6 @@ packages: typescript: optional: true - '@typescript-eslint/types@5.62.0': - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/types@7.0.1': resolution: {integrity: sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2310,15 +2302,6 @@ packages: resolution: {integrity: sha512-n0P2FP3YC3pD3yoiCf4lHqbUP45xlnOk8HkjB+LtKSUZZWLLJ8k1ZXZtQj7MEX22tytCMj//Bmq403xFuCwfIg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@5.62.0': - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/typescript-estree@7.0.1': resolution: {integrity: sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2346,12 +2329,6 @@ packages: typescript: optional: true - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - '@typescript-eslint/utils@7.0.1': resolution: {integrity: sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2370,10 +2347,6 @@ packages: peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@5.62.0': - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/visitor-keys@7.0.1': resolution: {integrity: sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -3408,8 +3381,8 @@ packages: eslint-plugin-jest: optional: true - eslint-plugin-storybook@0.8.0: - resolution: {integrity: sha512-CZeVO5EzmPY7qghO2t64oaFM+8FTaD4uzOEjHKp516exyTKo+skKAL9GI3QALS2BXhyALJjNtwbmr1XinGE8bA==} + eslint-plugin-storybook@0.9.0--canary.156.ed236ca.0: + resolution: {integrity: sha512-AOm5hbxT/0zp2dXPc3UH9WxUgvjjNXhWevb1i4DpAPMxxf9dGLmqIN3WlbsUSQ8CrQJnzDZbG1/DbKmjIzRLSg==} engines: {node: '>= 18'} peerDependencies: eslint: '>=6' @@ -3437,10 +3410,6 @@ packages: vitest: optional: true - eslint-scope@5.1.1: - 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} @@ -3508,10 +3477,6 @@ packages: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -5218,10 +5183,6 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} - requireindex@1.2.0: - resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} - engines: {node: '>=0.10.5'} - resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -5845,12 +5806,6 @@ packages: tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - tsx@4.7.1: resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} engines: {node: '>=18.0.0'} @@ -7546,7 +7501,7 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.4 + semver: 7.6.2 tar: 6.2.0 transitivePeerDependencies: - encoding @@ -8844,11 +8799,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@5.62.0': - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - '@typescript-eslint/scope-manager@7.0.1': dependencies: '@typescript-eslint/types': 7.0.1 @@ -8870,7 +8820,7 @@ snapshots: '@typescript-eslint/utils': 7.0.1(eslint@9.7.0)(typescript@5.3.3) debug: 4.3.4 eslint: 9.7.0 - ts-api-utils: 1.0.3(typescript@5.3.3) + ts-api-utils: 1.3.0(typescript@5.3.3) optionalDependencies: typescript: 5.3.3 transitivePeerDependencies: @@ -8888,28 +8838,12 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@5.62.0': {} - '@typescript-eslint/types@7.0.1': {} '@typescript-eslint/types@7.16.0': {} '@typescript-eslint/types@8.0.0-alpha.41': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3)': - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.4 - tsutils: 3.21.0(typescript@5.3.3) - optionalDependencies: - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/typescript-estree@7.0.1(typescript@5.3.3)': dependencies: '@typescript-eslint/types': 7.0.1 @@ -8918,8 +8852,8 @@ snapshots: globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) + semver: 7.6.2 + ts-api-utils: 1.3.0(typescript@5.3.3) optionalDependencies: typescript: 5.3.3 transitivePeerDependencies: @@ -8955,21 +8889,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@9.7.0)(typescript@5.3.3)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) - eslint: 9.7.0 - eslint-scope: 5.1.1 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - '@typescript-eslint/utils@7.0.1(eslint@9.7.0)(typescript@5.3.3)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0) @@ -8979,7 +8898,7 @@ snapshots: '@typescript-eslint/types': 7.0.1 '@typescript-eslint/typescript-estree': 7.0.1(typescript@5.3.3) eslint: 9.7.0 - semver: 7.5.4 + semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript @@ -9006,11 +8925,6 @@ snapshots: - supports-color - typescript - '@typescript-eslint/visitor-keys@5.62.0': - dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.0.1': dependencies: '@typescript-eslint/types': 7.0.1 @@ -10199,12 +10113,11 @@ snapshots: eslint: 9.7.0 globals: 13.24.0 - eslint-plugin-storybook@0.8.0(eslint@9.7.0)(typescript@5.3.3): + eslint-plugin-storybook@0.9.0--canary.156.ed236ca.0(eslint@9.7.0)(typescript@5.3.3): dependencies: '@storybook/csf': 0.0.1 - '@typescript-eslint/utils': 5.62.0(eslint@9.7.0)(typescript@5.3.3) + '@typescript-eslint/utils': 7.16.0(eslint@9.7.0)(typescript@5.3.3) eslint: 9.7.0 - requireindex: 1.2.0 ts-dedent: 2.2.0 transitivePeerDependencies: - supports-color @@ -10240,11 +10153,6 @@ snapshots: - supports-color - typescript - eslint-scope@5.1.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 @@ -10301,7 +10209,7 @@ snapshots: optionator: 0.9.3 progress: 2.0.3 regexpp: 3.2.0 - semver: 7.5.4 + semver: 7.6.2 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 @@ -10383,8 +10291,6 @@ snapshots: dependencies: estraverse: 5.3.0 - estraverse@4.3.0: {} - estraverse@5.3.0: {} estree-walker@1.0.1: {} @@ -11324,7 +11230,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.5.4 + semver: 7.6.2 make-error@1.3.6: {} @@ -11513,7 +11419,7 @@ snapshots: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.13.1 - semver: 7.5.4 + semver: 7.6.2 validate-npm-package-license: 3.0.4 normalize-path@3.0.0: {} @@ -12119,8 +12025,6 @@ snapshots: require-from-string@2.0.2: {} - requireindex@1.2.0: {} - resolve-from@4.0.0: {} resolve-from@5.0.0: {} @@ -12835,11 +12739,6 @@ snapshots: tslib@2.6.2: {} - tsutils@3.21.0(typescript@5.3.3): - dependencies: - tslib: 1.14.1 - typescript: 5.3.3 - tsx@4.7.1: dependencies: esbuild: 0.19.11