From 56eb4c47be0008324f56b486dcecbed7f6e1b160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Mon, 24 Jun 2024 15:16:18 +0200 Subject: [PATCH] Remove obsolete ESLint comment directives --- MIGRATION.md | 1 - packages/circuit-ui/components/Anchor/Anchor.tsx | 1 - packages/circuit-ui/components/BodyLarge/BodyLarge.tsx | 1 - packages/circuit-ui/components/Button/Button.tsx | 1 - packages/circuit-ui/components/Button/IconButton.tsx | 1 - packages/circuit-ui/components/Button/base.tsx | 1 - packages/circuit-ui/components/Calendar/CalendarService.ts | 2 +- packages/circuit-ui/components/Carousel/constants.ts | 1 - packages/circuit-ui/components/CloseButton/CloseButton.tsx | 2 +- packages/circuit-ui/components/Hamburger/Hamburger.tsx | 2 +- .../components/PhoneNumberInput/PhoneNumberInputService.spec.ts | 1 - packages/circuit-ui/components/Portal/Portal.ts | 1 - .../SideNavigation/components/PrimaryLink/PrimaryLink.spec.tsx | 1 - packages/circuit-ui/hooks/useClickOutside/useClickOutside.ts | 1 - packages/circuit-ui/types/global.d.ts | 1 - packages/circuit-ui/types/return-type.ts | 1 - packages/circuit-ui/util/i18n.spec.ts | 2 -- packages/circuit-ui/util/refs.ts | 1 - scripts/.eslintrc.js | 1 - vite.config.mts | 1 - 20 files changed, 3 insertions(+), 21 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 6c7f1a9916..6d04a392aa 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -796,7 +796,6 @@ Previously, many apps would use `CreateStyled`: import styled, { CreateStyled } from '@emotion/styled'; import { Theme } from '@sumup/design-tokens'; -// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion export default styled as CreateStyled; ``` diff --git a/packages/circuit-ui/components/Anchor/Anchor.tsx b/packages/circuit-ui/components/Anchor/Anchor.tsx index 39fcf371cc..b8fa61fc97 100644 --- a/packages/circuit-ui/components/Anchor/Anchor.tsx +++ b/packages/circuit-ui/components/Anchor/Anchor.tsx @@ -42,7 +42,6 @@ export interface BaseProps extends BodyProps { /** * The ref to the HTML DOM element, it can be a button an anchor or a span, typed as any for now because of complex js manipulation with styled components */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any ref?: Ref; } type LinkElProps = Omit, 'onClick'>; diff --git a/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx b/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx index ac0aaa26eb..65516f2978 100644 --- a/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx +++ b/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx @@ -34,7 +34,6 @@ export interface BodyLargeProps extends HTMLAttributes { /** * The ref to the HTML DOM element. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any ref?: Ref; } diff --git a/packages/circuit-ui/components/Button/Button.tsx b/packages/circuit-ui/components/Button/Button.tsx index 825d7b0ed7..4843346ae2 100644 --- a/packages/circuit-ui/components/Button/Button.tsx +++ b/packages/circuit-ui/components/Button/Button.tsx @@ -63,7 +63,6 @@ export type ButtonProps = SharedButtonProps & { * to a different screen. */ export const Button: ForwardRefExoticComponent< - // eslint-disable-next-line @typescript-eslint/no-explicit-any PropsWithoutRef & RefAttributes > = createButtonComponent( 'Button', diff --git a/packages/circuit-ui/components/Button/IconButton.tsx b/packages/circuit-ui/components/Button/IconButton.tsx index ca484bc0a9..ca92e2009b 100644 --- a/packages/circuit-ui/components/Button/IconButton.tsx +++ b/packages/circuit-ui/components/Button/IconButton.tsx @@ -61,7 +61,6 @@ export type IconButtonProps = SharedButtonProps & { * to a different screen. */ export const IconButton: ForwardRefExoticComponent< - // eslint-disable-next-line @typescript-eslint/no-explicit-any PropsWithoutRef & RefAttributes > = createButtonComponent( 'IconButton', diff --git a/packages/circuit-ui/components/Button/base.tsx b/packages/circuit-ui/components/Button/base.tsx index 4f35017186..64a091f051 100644 --- a/packages/circuit-ui/components/Button/base.tsx +++ b/packages/circuit-ui/components/Button/base.tsx @@ -127,7 +127,6 @@ export function createButtonComponent( // TODO: Refactor to `mapClassName` once the deprecations have been removed. mapProps: (props: Props) => CreateButtonComponentProps, ) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const Button = forwardRef((props, ref) => { const { children, diff --git a/packages/circuit-ui/components/Calendar/CalendarService.ts b/packages/circuit-ui/components/Calendar/CalendarService.ts index 2bdbc71770..d33cb2dbe2 100644 --- a/packages/circuit-ui/components/Calendar/CalendarService.ts +++ b/packages/circuit-ui/components/Calendar/CalendarService.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -// biome-ignore lint/suspicious/noShadowRestrictedNames: Necessary to add support for Temporal objects to the`Intl` APIs +// biome-ignore lint/suspicious/noShadowRestrictedNames: Necessary to add support for Temporal objects to the `Intl` APIs import { Temporal, Intl } from 'temporal-polyfill'; import type { Locale } from '../../util/i18n.js'; diff --git a/packages/circuit-ui/components/Carousel/constants.ts b/packages/circuit-ui/components/Carousel/constants.ts index 8010aa92b8..c56ae33f0f 100644 --- a/packages/circuit-ui/components/Carousel/constants.ts +++ b/packages/circuit-ui/components/Carousel/constants.ts @@ -19,7 +19,6 @@ export const ANIMATION_DURATION = 640; export const SLIDE_DURATION = 5000; -// eslint-disable-next-line @typescript-eslint/naming-convention export enum SLIDE_DIRECTIONS { FORWARD = 'forward', BACK = 'back', diff --git a/packages/circuit-ui/components/CloseButton/CloseButton.tsx b/packages/circuit-ui/components/CloseButton/CloseButton.tsx index 7285c60fba..3f4b15a353 100644 --- a/packages/circuit-ui/components/CloseButton/CloseButton.tsx +++ b/packages/circuit-ui/components/CloseButton/CloseButton.tsx @@ -23,7 +23,7 @@ export type CloseButtonProps = Omit; /** * A generic close button. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any + export const CloseButton = forwardRef( ({ label = 'Close', children = label, ...props }, ref) => ( ( ( { diff --git a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.spec.ts b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.spec.ts index b472915889..acecc17410 100644 --- a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.spec.ts +++ b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.spec.ts @@ -38,7 +38,6 @@ describe('PhoneNumberInputService', () => { it('should replace unsupported whitespace characters with single spaces in the subscriber number', () => { const countryCode = '+1'; - // eslint-disable-next-line no-tabs const subscriberNumber = '234 567 8910'; const actual = normalizePhoneNumber(countryCode, subscriberNumber); expect(actual).toBe('+1234 567 8910'); diff --git a/packages/circuit-ui/components/Portal/Portal.ts b/packages/circuit-ui/components/Portal/Portal.ts index 807665a690..a8f22736cb 100644 --- a/packages/circuit-ui/components/Portal/Portal.ts +++ b/packages/circuit-ui/components/Portal/Portal.ts @@ -44,7 +44,6 @@ export function Portal({ setContainer(getContainer()); // In order to prevent performance issues, this hook is only run once. // This means that the container can't be changed after the initial render. - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return container && createPortal(children, container); diff --git a/packages/circuit-ui/components/SideNavigation/components/PrimaryLink/PrimaryLink.spec.tsx b/packages/circuit-ui/components/SideNavigation/components/PrimaryLink/PrimaryLink.spec.tsx index ade8a82c90..40f0827a92 100644 --- a/packages/circuit-ui/components/SideNavigation/components/PrimaryLink/PrimaryLink.spec.tsx +++ b/packages/circuit-ui/components/SideNavigation/components/PrimaryLink/PrimaryLink.spec.tsx @@ -65,7 +65,6 @@ describe('PrimaryLink', () => { it('should render with a suffix icon', () => { renderPrimaryLink(render, { ...baseProps, - // eslint-disable-next-line react/display-name suffix: (props) =>
, }); expect(screen.getByTestId('suffix')).toBeVisible(); diff --git a/packages/circuit-ui/hooks/useClickOutside/useClickOutside.ts b/packages/circuit-ui/hooks/useClickOutside/useClickOutside.ts index 94457dfdbb..54d2af3872 100644 --- a/packages/circuit-ui/hooks/useClickOutside/useClickOutside.ts +++ b/packages/circuit-ui/hooks/useClickOutside/useClickOutside.ts @@ -53,6 +53,5 @@ export function useClickOutside( // The `refs` array is recreated on each render, but the ref objects inside // don't necessarily change. Spreading the array allows React to compare the // ref objects themselves. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [...refs, callback, active]); } diff --git a/packages/circuit-ui/types/global.d.ts b/packages/circuit-ui/types/global.d.ts index 129336718e..6d08c8e382 100644 --- a/packages/circuit-ui/types/global.d.ts +++ b/packages/circuit-ui/types/global.d.ts @@ -18,7 +18,6 @@ import type { Theme as CircuitTheme } from '@sumup/design-tokens'; import 'react'; declare module '@emotion/react' { - // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Theme extends CircuitTheme {} } diff --git a/packages/circuit-ui/types/return-type.ts b/packages/circuit-ui/types/return-type.ts index d9389d546e..974820d61f 100644 --- a/packages/circuit-ui/types/return-type.ts +++ b/packages/circuit-ui/types/return-type.ts @@ -15,5 +15,4 @@ import type { ReactElement } from 'react'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any export type ReturnType = ReactElement | null; diff --git a/packages/circuit-ui/util/i18n.spec.ts b/packages/circuit-ui/util/i18n.spec.ts index 1519fc3e17..5cf247045a 100644 --- a/packages/circuit-ui/util/i18n.spec.ts +++ b/packages/circuit-ui/util/i18n.spec.ts @@ -31,7 +31,6 @@ describe('i18n', () => { let languageGetter: MockInstance; beforeEach(() => { - // eslint-disable-next-line no-global-assign window = originalWindow; languagesGetter = vi.spyOn(window.navigator, 'languages', 'get'); languageGetter = vi.spyOn(window.navigator, 'language', 'get'); @@ -39,7 +38,6 @@ describe('i18n', () => { it('should return the default locale in server environments', () => { // @ts-expect-error The window object is undefined in server environments - // eslint-disable-next-line no-global-assign window = undefined; const actual = getBrowserLocale(); expect(actual).toBe(DEFAULT_LOCALE); diff --git a/packages/circuit-ui/util/refs.ts b/packages/circuit-ui/util/refs.ts index 1802e79427..e98c7fd3da 100644 --- a/packages/circuit-ui/util/refs.ts +++ b/packages/circuit-ui/util/refs.ts @@ -25,7 +25,6 @@ export function applyMultipleRefs( if (typeof ref === 'function') { ref(instance); } else if (ref) { - // eslint-disable-next-line no-param-reassign ref.current = instance; } }); diff --git a/scripts/.eslintrc.js b/scripts/.eslintrc.js index ff6a8eddd0..1a76970680 100644 --- a/scripts/.eslintrc.js +++ b/scripts/.eslintrc.js @@ -13,7 +13,6 @@ * limitations under the License. */ -// eslint-disable-next-line import/no-extraneous-dependencies module.exports = require('@sumup-oss/foundry/eslint')({ rules: { 'arrow-parens': 'off', diff --git a/vite.config.mts b/vite.config.mts index 8aa30cbfa9..8221d84154 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -16,7 +16,6 @@ import { defineConfig } from 'vite'; import GithubActionsReporter from 'vitest-github-actions-reporter'; -// eslint-disable-next-line import/no-relative-packages import { css } from './packages/circuit-ui/vite.config.js'; export default defineConfig({