Skip to content

Commit

Permalink
Style(web-react): Fix lint errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Jan 10, 2024
1 parent f4e2b5e commit 9949ffc
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/web-react/config/rollup.config.js
@@ -1,6 +1,6 @@
import replace from '@rollup/plugin-replace';
import path from 'path';
import { terser as minify } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';

const entryPoints = require('../scripts/entryPoints');

Expand Down
8 changes: 4 additions & 4 deletions packages/web-react/src/components/Dropdown/Dropdown.tsx
@@ -1,9 +1,12 @@
/**
* @deprecated Dropdown component is deprecated and will be removed in the next major version. Please use "DropdownModern" component instead.
*/
import classNames from 'classnames';
import React, { LegacyRef, createElement, useRef } from 'react';
import { Placements } from '../../constants';
import DropdownWrapper from './DropdownWrapper';
import { useDeprecationMessage, useStyleProps } from '../../hooks';
import { SpiritDropdownProps } from '../../types';
import DropdownWrapper from './DropdownWrapper';
import { useDropdown } from './useDropdown';
import { useDropdownAriaProps } from './useDropdownAriaProps';
import { useDropdownStyleProps } from './useDropdownStyleProps';
Expand All @@ -13,9 +16,6 @@ const defaultProps = {
placement: Placements.BOTTOM_LEFT,
};

/**
* @deprecated Dropdown component is deprecated and will be removed in the next major version. Please use "DropdownModern" component instead.
*/
export const Dropdown = (props: SpiritDropdownProps) => {
const {
id = Math.random().toString(36).slice(2, 7),
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/src/hooks/useIsomorphicLayoutEffect.ts
@@ -1,5 +1,6 @@
/**
* This file fixes the problem of using useLayoutEffect hook on the server side.
*
* @see https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
* @see https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/types/header.ts
Expand Up @@ -58,6 +58,7 @@ export interface BaseHeaderDialogLinkProps extends ChildrenProps, StyleProps, Tr
export type HeaderDialogLinkProps<E extends ElementType = 'a'> = {
/**
* The HTML element or React element used to render the Link, e.g. 'a'.
*
* @default 'a'
*/
elementType?: E;
Expand All @@ -79,6 +80,7 @@ export interface HeaderLinkBaseProps extends ChildrenProps, StyleProps, Transfer
export type HeaderLinkProps<E extends ElementType = 'a'> = {
/**
* The HTML element or React element used to render the Link, e.g. 'a'.
*
* @default 'a'
*/
elementType?: E;
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/src/types/item.ts
Expand Up @@ -4,6 +4,7 @@ import { StyleProps, TransferProps } from './shared';
export interface AriaItemElementTypeProps<T extends ElementType = 'button'> {
/**
* The HTML element or React element used to render the item, e.g. 'div', 'span'.
*
* @default 'button'
*/
elementType?: T | JSXElementConstructor<unknown>;
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/src/types/shared/element.ts
Expand Up @@ -21,6 +21,7 @@ export type SpiritPolymorphicElementPropsWithoutRef<E extends ElementType, P> =
>;
/**
* Type React's forwarded ref with `PolymorphicRef` to allow generic `elementType` to be strongly typed, e.g. component allows switching of elements
*
* @see https://www.freecodecamp.org/news/build-strongly-typed-polymorphic-components-with-react-and-typescript/
*/
export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/src/types/tabs.ts
Expand Up @@ -21,6 +21,7 @@ export interface TabLinkBaseProps extends ChildrenProps, StyleProps, TransferPro
export type TabLinkProps<E extends ElementType = 'a'> = {
/**
* The HTML element or React element used to render the Link, e.g. 'a'.
*
* @default 'a'
*/
elementType?: E;
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/src/utils/string.ts
@@ -1,5 +1,6 @@
/**
* Converts a kebab-case string to camelCase
*
* @param str
*/
export const kebabCaseToCamelCase = (str: string): string => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());

0 comments on commit 9949ffc

Please sign in to comment.