Skip to content

Commit

Permalink
chore: enable noUnusedImports biome rule (digdir#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes authored Oct 24, 2024
1 parent a452813 commit f96289a
Show file tree
Hide file tree
Showing 28 changed files with 14 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { ColorNumber } from '@digdir/designsystemet/color';
import {
areColorsContrasting,
getApcaContrastLc,
getColorNameFromNumber,
} from '@digdir/designsystemet/color';
import {
CheckmarkCircleFillIcon,
Expand Down
1 change: 0 additions & 1 deletion apps/_components/src/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Heading, Link, Paragraph } from '@digdir/designsystemet-react';
import cl from 'clsx/lite';
import Image from 'next/image';
import NextLink from 'next/link';
import { type ReactNode, forwardRef } from 'react';
import { Container } from '../';
Expand Down
1 change: 0 additions & 1 deletion apps/storefront/app/komponenter/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentCard } from '@components';
import React from 'react';

import { data } from './component-list';

Expand Down
1 change: 0 additions & 1 deletion apps/storefront/components/VersionBanner/VersionBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cl from 'clsx/lite';
import React from 'react';
import classes from './VersionBanner.module.css';

function VersionBanner() {
Expand Down
1 change: 0 additions & 1 deletion apps/storefront/layouts/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Heading, Link, Paragraph } from '@digdir/designsystemet-react';
import { ArrowLeftIcon } from '@navikt/aksel-icons';
import { Container } from '@repo/components';
import cl from 'clsx/lite';
import NextLink from 'next/link';
import type * as React from 'react';

Expand Down
2 changes: 0 additions & 2 deletions apps/storybook/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import './style.css';
import '../../../packages/css/index.css';
import '@digdir/designsystemet-theme/digdir.css';

import { withThemeByDataAttribute } from '@storybook/addon-themes';
import type { Preview } from '@storybook/react';

import type { LinkProps } from '@digdir/designsystemet-react';
Expand Down
2 changes: 1 addition & 1 deletion apps/theme/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import type { CssColor } from '@adobe/leonardo-contrast-colors';
import { Heading, Paragraph } from '@digdir/designsystemet-react';
import { Heading } from '@digdir/designsystemet-react';
import type {
ColorError,
ColorInfo,
Expand Down
2 changes: 1 addition & 1 deletion apps/theme/app/slik-bruker-du-verktoyet/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { Alert, Heading, Link, Paragraph } from '@digdir/designsystemet-react';
import { Heading, Link, Paragraph } from '@digdir/designsystemet-react';
import { Container } from '@repo/components';

import classes from './page.module.css';
Expand Down
2 changes: 1 addition & 1 deletion apps/theme/components/ColorPicker/ColorPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CssColor } from '@adobe/leonardo-contrast-colors';
import { Link, Popover } from '@digdir/designsystemet-react';
import { CheckmarkIcon, ExclamationmarkIcon } from '@navikt/aksel-icons';
import { ExclamationmarkIcon } from '@navikt/aksel-icons';
import { useClickOutside } from '@react-awesome/use-click-outside';
import cl from 'clsx/lite';
import { useEffect, useId, useRef, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/theme/components/ThemeToolbar/ThemeToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CssColor } from '@adobe/leonardo-contrast-colors';
import { Button, Label, Select, Tooltip } from '@digdir/designsystemet-react';
import { Button, Tooltip } from '@digdir/designsystemet-react';
import type {
ColorError,
ContrastMode,
Expand Down
3 changes: 2 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"useAriaPropsForRole": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
"useExhaustiveDependencies": "off",
"noUnusedImports": "error"
},
"style": {
"useTemplate": "off",
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/tokens/build/utils/entryfile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'node:path';
import chalk from 'chalk';
import glob from 'fast-glob';
import fs from 'fs-extra';
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/tokens/write/generate$themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { type ThemeObject, TokenSetStatus } from '@tokens-studio/types';

import type { ColorMode } from '../../colors/types.js';

import * as R from 'ramda';

const capitalize = (word: string) => word.charAt(0).toUpperCase() + word.slice(1);

const createHash = (text: string) => crypto.hash('sha1', text);
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Slot } from '@radix-ui/react-slot';
import cl from 'clsx/lite';
import { Fragment, forwardRef } from 'react';
import type { HTMLAttributes, ReactNode } from 'react';
import type { Size } from '../../types';

export type AvatarProps = {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryFn, StoryObj } from '@storybook/react';
import type { Meta, StoryObj } from '@storybook/react';
import { expect, userEvent, within } from '@storybook/test';

import { HelpText } from '.';
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Slot } from '@radix-ui/react-slot';
import cl from 'clsx/lite';
import type { LabelHTMLAttributes } from 'react';
import { forwardRef } from 'react';
import type { Size } from '../../types';

export type LabelProps = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Modal/ModalContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useCallback, useRef, useState } from 'react';
import { createContext, useRef } from 'react';
import type { ReactNode, RefObject } from 'react';

export const Context = createContext<RefObject<HTMLDialogElement>>({
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Pagination/usePagination.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import type { Dispatch, MouseEvent, SetStateAction } from 'react';
import type { MouseEvent } from 'react';
import type { PaginationButtonProps } from './PaginationButton';

const getSteps = (now: number, max: number, show: number) => {
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/Popover/Popover.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import userEvent from '@testing-library/user-event';
import { act } from 'react';

import type { PopoverProps } from './';

import { Button } from '../Button';
import { Popover } from './';

const contentText = 'popover content';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Table/TableHeaderCell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AriaAttributes } from 'react';
import { type MouseEvent, type ThHTMLAttributes, forwardRef } from 'react';
import { type ThHTMLAttributes, forwardRef } from 'react';

export type TableHeaderCellProps = {
/**
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/Tag/Tag.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Stack } from '@doc-components';
import type { Meta, StoryFn, StoryObj } from '@storybook/react';

import type { TagProps } from '.';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
ReactElement,
RefAttributes,
} from 'react';
import { Fragment, cloneElement, forwardRef, useRef, useState } from 'react';
import { Fragment, cloneElement, forwardRef, useState } from 'react';

import type { PortalProps } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Slot } from '@radix-ui/react-slot';
import cl from 'clsx/lite';
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import type { Size } from '../../types';

export type ValidationMessageProps = {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { render, screen } from '@testing-library/react';
import { vi } from 'vitest';

import { Input, Label } from '../..';
import { fieldObserver } from './fieldObserver';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Input/InputAffix.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cl from 'clsx/lite';
import type { HTMLAttributes, InputHTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';

export type InputAffixWrapperProps = Omit<
Expand Down
6 changes: 1 addition & 5 deletions packages/react/src/components/form/Select/useSelect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import type {
KeyboardEventHandler,
MouseEventHandler,
SelectHTMLAttributes,
} from 'react';
import type { SelectHTMLAttributes } from 'react';
import { useContext } from 'react';

import { FieldsetContext } from '../Fieldset/FieldsetContext';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryFn } from '@storybook/react';
import type { Meta } from '@storybook/react';
import { useState } from 'react';

import { Button } from '../../../components';
Expand Down
1 change: 0 additions & 1 deletion test/vitest.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { TestingLibraryMatchers } from '@testing-library/jest-dom';
import type { Assertion } from 'vitest';

declare module 'vi' {
interface Assertion<T> extends TestingLibraryMatchers<T> {}
Expand Down

0 comments on commit f96289a

Please sign in to comment.