From 2fa1c004fe01e68f231eed12d24621046b27efa1 Mon Sep 17 00:00:00 2001 From: dangreen Date: Fri, 29 Mar 2024 17:37:47 +0400 Subject: [PATCH] fix(eslint-config): fix ts rules --- .../src/rules/typescript-requiring-type-checking.js | 1 + packages/eslint-config/src/rules/typescript.js | 1 - packages/eslint-config/src/storybook.js | 10 ++++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/eslint-config/src/rules/typescript-requiring-type-checking.js b/packages/eslint-config/src/rules/typescript-requiring-type-checking.js index 9f312b2..b56d5db 100644 --- a/packages/eslint-config/src/rules/typescript-requiring-type-checking.js +++ b/packages/eslint-config/src/rules/typescript-requiring-type-checking.js @@ -15,6 +15,7 @@ module.exports = { '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'off', + '@typescript-eslint/prefer-optional-chain': 'error', '@typescript-eslint/prefer-readonly': 'error', '@typescript-eslint/prefer-readonly-parameter-types': 'off', '@typescript-eslint/prefer-reduce-type-parameter': 'error', diff --git a/packages/eslint-config/src/rules/typescript.js b/packages/eslint-config/src/rules/typescript.js index d0575ff..35ff9cd 100644 --- a/packages/eslint-config/src/rules/typescript.js +++ b/packages/eslint-config/src/rules/typescript.js @@ -153,7 +153,6 @@ module.exports = { '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/prefer-namespace-keyword': 'off', - '@typescript-eslint/prefer-optional-chain': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/type-annotation-spacing': 'error', '@typescript-eslint/unified-signatures': 'error', diff --git a/packages/eslint-config/src/storybook.js b/packages/eslint-config/src/storybook.js index 19a3c09..2f8c2f9 100644 --- a/packages/eslint-config/src/storybook.js +++ b/packages/eslint-config/src/storybook.js @@ -14,7 +14,7 @@ const extensions = [ module.exports = { overrides: [ { - files: makePatterns(postfixes, extensions).concat('.storybook/**/*').concat('storybook/**/*'), + files: makePatterns(postfixes, extensions).concat('.storybook/**/*'), rules: { 'max-classes-per-file': 'off', 'no-magic-numbers': 'off', @@ -22,7 +22,13 @@ module.exports = { 'max-nested-callbacks': 'off', 'react/no-array-index-key': 'off', 'react/jsx-no-bind': 'off', - 'import/no-default-export': 'off' + 'import/no-default-export': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-explicit-any': 'off' } } ]