diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 16892adc5..24b4a1a7d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,17 +1,17 @@ module.exports = { overrides: [ { - files: ['**/*.test.ts', '**/*.test.tsx', '**/*.stories.tsx'], + files: ['**/*.tsx'], rules: { - 'max-lines-per-function': [1, { max: 300, skipBlankLines: true, skipComments: true }], - 'max-nested-callbacks': [1, 4], - 'no-console': 0, + 'max-lines-per-function': [1, { max: 200, skipBlankLines: true, skipComments: true }], }, }, { - files: ['**/*.tsx'], + files: ['**/*.test.ts', '**/*.test.tsx', '**/*.stories.tsx'], rules: { - 'max-lines-per-function': [1, { max: 150, skipBlankLines: true, skipComments: true }], + 'max-lines-per-function': [1, { max: 500, skipBlankLines: true, skipComments: true }], + 'max-nested-callbacks': [1, 8], + 'no-console': 0, }, }, ], @@ -47,7 +47,7 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/prefer-interface': 0, '@typescript-eslint/no-object-literal-type-assertion': 0, - '@typescript-eslint/no-shadow': 1, + '@typescript-eslint/no-shadow': 0, '@typescript-eslint/explicit-function-return-type': 0, '@typescript-eslint/no-unused-vars': 0, '@typescript-eslint/no-use-before-define': [ @@ -83,8 +83,8 @@ module.exports = { curly: [1, 'multi-line'], 'max-lines': [1, { max: 300, skipBlankLines: true, skipComments: true }], 'max-lines-per-function': [1, { max: 100, skipBlankLines: true, skipComments: true }], - 'max-depth': [2, 2], - 'max-nested-callbacks': [1, 2], + 'max-depth': [2, 5], + 'max-nested-callbacks': [1, 5], 'newline-before-return': 1, 'no-console': [1, { allow: ['error'] }], 'no-debugger': 1, diff --git a/packages/components/checkbox/src/CheckboxGroup.tsx b/packages/components/checkbox/src/CheckboxGroup.tsx index 615c2b4db..a64c6b969 100644 --- a/packages/components/checkbox/src/CheckboxGroup.tsx +++ b/packages/components/checkbox/src/CheckboxGroup.tsx @@ -44,7 +44,6 @@ export const CheckboxGroup = forwardRef( const current = useMemo(() => { const handleCheckedChange = (checked: boolean, changed: string) => { const values = value || [] - /* eslint-disable-next-line max-nested-callbacks */ const modified = checked ? [...values, changed] : values.filter(val => val !== changed) setValue(modified) diff --git a/packages/components/form-field/src/FormFieldProvider.tsx b/packages/components/form-field/src/FormFieldProvider.tsx index cea58ce97..21b0c3707 100644 --- a/packages/components/form-field/src/FormFieldProvider.tsx +++ b/packages/components/form-field/src/FormFieldProvider.tsx @@ -24,7 +24,6 @@ export const FormFieldProvider = ({ }, []) const handleMessageIdRemove = useCallback((msgId: string) => { - /* eslint-disable-next-line max-nested-callbacks */ setMessageIds(ids => ids.filter(current => current !== msgId)) }, []) diff --git a/packages/components/popover/src/Popover.test.tsx b/packages/components/popover/src/Popover.test.tsx index ef9c5f24c..59c20899a 100644 --- a/packages/components/popover/src/Popover.test.tsx +++ b/packages/components/popover/src/Popover.test.tsx @@ -1,5 +1,3 @@ -/* eslint-disable max-nested-callbacks */ -/* eslint-disable max-lines-per-function */ import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { mockResizeObserver } from 'jsdom-testing-mocks' diff --git a/packages/utils/tailwind-plugins/spark-theme/index.js b/packages/utils/tailwind-plugins/spark-theme/index.js index 7883b8d9a..b79f0a203 100644 --- a/packages/utils/tailwind-plugins/spark-theme/index.js +++ b/packages/utils/tailwind-plugins/spark-theme/index.js @@ -60,7 +60,6 @@ module.exports = plugin.withOptions( Object.entries(themes).forEach(([key, value]) => { if (key === 'default') return - /* eslint-disable-next-line @typescript-eslint/no-shadow */ const { missingItems, additionalItems } = retrieveArrayDifferences({ ref: getAllObjectKeys(themeUtils.defaultTheme), comp: getAllObjectKeys(value),