Skip to content

Commit

Permalink
chore(eslint): update config
Browse files Browse the repository at this point in the history
  • Loading branch information
philibea committed Dec 11, 2024
1 parent 6eae1b6 commit a1b2284
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 174 deletions.
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const disableRules = {
// ---- biome rules ----
'import/order': 'off',
'import/no-unresolved': 'off',
'@stylistic/no-extra-semi': 'off',
'@stylistic/brace-style': 'off',

// to check
'react/no-unused-prop-types': 'off',
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
"format": "biome check --linter-enabled=false --write .",
"format:check": "biome check --linter-enabled=false --verbose .",
"format:ci": "biome ci --linter-enabled=false .",
"lint:fix": "pnpm run lint --fix",
"lint": "eslint --report-unused-disable-directives --cache .",
"lint:fix": "pnpm run lint --fix",
"oxc": "oxlint -c .oxlintrc.json",
"oxc:fix": "pnpm run oxlint --fix",
"prepare": "husky",
"tokens:update": "node ./scripts/figma-synchronise-tokens.mjs && pnpm run format packages/themes/src/themes/console",
"icons:update": "tsx ./scripts/generate-icons-file.ts && biome format --write packages/icons",
Expand Down Expand Up @@ -108,7 +110,7 @@
"@eslint/compat": "1.2.4",
"@eslint/eslintrc": "3.2.0",
"@manypkg/cli": "0.23.0",
"@scaleway/eslint-config-react": "5.2.0",
"@scaleway/eslint-config-react": "4.0.9",
"@scaleway/tsconfig": "1.1.1",
"@size-limit/file": "11.1.6",
"@size-limit/preset-big-lib": "11.1.6",
Expand Down
12 changes: 4 additions & 8 deletions packages/ui/src/components/ExpandableCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import styled from '@emotion/styled'
import { Icon } from '@ultraviolet/icons/legacy'
import { ArrowDownIcon } from '@ultraviolet/icons'
import type { ForwardedRef, ReactNode } from 'react'
import { forwardRef, useRef } from 'react'
import type { XOR } from '../../types'
import { ExpandableCardTitle } from './components/Title'

const ArrowIcon = styled(Icon)``
const StyledArrowIcon = styled(ArrowDownIcon)``

const StyledSummary = styled.summary`
display: flex;
Expand Down Expand Up @@ -39,7 +39,7 @@ const StyledDetails = styled.details`
border-color: ${({ theme }) => theme.colors.primary.border};
}
${ArrowIcon} {
${StyledArrowIcon} {
transform: rotate(180deg);
}
}
Expand Down Expand Up @@ -107,11 +107,7 @@ const BaseExpandableCard = forwardRef(
: undefined
}
>
<ArrowIcon
sentiment="neutral"
disabled={disabled}
name="arrow-down"
/>
<StyledArrowIcon sentiment="neutral" disabled={disabled} />
{typeof header === 'string' ? (
<ExpandableCardTitle size={size} disabled={disabled}>
{header}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ describe('LineChart', () => {
))

test.skip('renders correctly when chart is hovered', async () => {
const { asFragment, debug } = renderWithTheme(
const { asFragment } = renderWithTheme(
<LineChart data={lineChartData} withLegend xScale={{ type: 'linear' }} />,
)
// eslint-disable-next-line testing-library/no-node-access
const line = document.querySelector('svg[role="img"] g path')
debug()
if (!line) throw new Error('LineChart line path not found')
await userEvent.unhover(line)
await userEvent.hover(line)
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/Loader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ const StyledSvg = styled('svg', {

type LoaderProps = {
active?: boolean
color?: Color | string
color?: Color | (string & NonNullable<unknown>)
percentage?: number
size?: number | string
strokeWidth?: number
/**
* Text is placed in center of ProgressCircle.
*/
text?: string
trailColor?: Color | string
trailColor?: Color | (string & NonNullable<unknown>)
/**
* Label should be defined for accessibility, to indicate what is loading
*/
Expand All @@ -46,7 +46,7 @@ type LoaderProps = {

const Text = styled('text', {
shouldForwardProp: prop => !['color'].includes(prop),
})<{ color: Color | string }>`
})<{ color: Color | (string & NonNullable<unknown>) }>`
fill: ${({ theme, color }) =>
theme.colors[color as Color]?.backgroundStrong || color};
Expand Down
9 changes: 2 additions & 7 deletions packages/ui/src/components/Notice/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { Icon } from '@ultraviolet/icons/legacy'
import { InformationOutlineIcon } from '@ultraviolet/icons'
import type { ReactNode } from 'react'
import { Text } from '../Text'

Expand Down Expand Up @@ -31,12 +31,7 @@ export const Notice = ({
data-testid={dataTestId}
className={className}
>
<Icon
name="information-outline"
size={16}
color="neutral"
prominence="weak"
/>
<InformationOutlineIcon size={16} sentiment="neutral" prominence="weak" />
{children}
</StyledSpan>
)
12 changes: 5 additions & 7 deletions packages/ui/src/components/NumberInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { Icon } from '@ultraviolet/icons/legacy'
import { MinusIcon, PlusIcon } from '@ultraviolet/icons'
import type {
ChangeEventHandler,
FocusEventHandler,
Expand Down Expand Up @@ -362,10 +362,9 @@ export const NumberInput = ({
sentiment="primary"
size="small"
>
<Icon
name="minus"
<MinusIcon
size={iconSizes[size]}
color="primary"
sentiment="primary"
disabled={isMinusDisabled}
/>
</StyledSelectButton>
Expand Down Expand Up @@ -414,10 +413,9 @@ export const NumberInput = ({
sentiment="primary"
size="small"
>
<Icon
name="plus"
<PlusIcon
size={iconSizes[size]}
color="primary"
sentiment="primary"
disabled={isPlusDisabled}
/>
</StyledSelectButton>
Expand Down
25 changes: 18 additions & 7 deletions packages/ui/src/components/PasswordCheck/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import styled from '@emotion/styled'
import { Icon } from '@ultraviolet/icons/legacy'
import {
CheckCircleOutlineIcon,
CloseCircleOutlineIcon,
} from '@ultraviolet/icons'
import { Stack } from '../Stack'
import { Text } from '../Text'

Expand Down Expand Up @@ -37,12 +40,20 @@ export const PasswordCheck = ({
<PasswordCheckContainer className={className} data-testid={dataTestId}>
{rules.map(rule => (
<Stack direction="row" gap={1} alignItems="center" key={rule.name}>
<Icon
name={rule.valid ? 'checkbox-circle-outline' : 'close-circle-outline'}
color={rule.valid ? 'success' : 'neutral'}
prominence="weak"
size={20}
/>
{rule.valid ? (
<CheckCircleOutlineIcon
sentiment="success"
prominence="weak"
size={20}
/>
) : (
<CloseCircleOutlineIcon
sentiment="neutral"
prominence="weak"
size={20}
/>
)}

<Text as="p" variant="bodySmall">
{rule.text}
</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { StoryFn } from '@storybook/react'
import { Icon } from '@ultraviolet/icons/legacy'
import { HelpCircleOutlineIcon } from '@ultraviolet/icons'
import { Popover } from '..'

export const Template: StoryFn<typeof Popover> = props => (
Expand All @@ -9,6 +9,6 @@ export const Template: StoryFn<typeof Popover> = props => (
title="Popover Title"
content="This is a simple text content inside the popover. You can customize it by passing text into content property."
>
<Icon name="help-circle-outline" size={24} variant="outlined" />
<HelpCircleOutlineIcon size={24} />
</Popover>
)
6 changes: 2 additions & 4 deletions packages/ui/src/components/SearchInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { Icon } from '@ultraviolet/icons/legacy'
import { SearchIcon } from '@ultraviolet/icons'
import type { Ref } from 'react'
import {
forwardRef,
Expand Down Expand Up @@ -276,9 +276,7 @@ export const SearchInput = forwardRef(
>
<StyledTextInputV2
ref={innerSearchInputRef}
prefix={
<Icon name="search" disabled={disabled} sentiment="neutral" />
}
prefix={<SearchIcon disabled={disabled} sentiment="neutral" />}
suffix={
shortcut && searchTerms.length === 0 ? (
<KeyGroup disabled={disabled} keys={keys} />
Expand Down
Loading

0 comments on commit a1b2284

Please sign in to comment.