Skip to content

Commit

Permalink
chore: Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 11, 2024
1 parent 2e46f5d commit ca4071b
Show file tree
Hide file tree
Showing 64 changed files with 47 additions and 103 deletions.
1 change: 0 additions & 1 deletion demo/src/Components/ConsentPopup/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {ConsentPopup as Component} from '@diplodoc/components';
import {Button, TextInput} from '@gravity-ui/uikit';

Expand Down
3 changes: 0 additions & 3 deletions demo/src/Components/DocPage/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {join} from 'path';

import React, {useCallback, useEffect, useState} from 'react';

import {
DEFAULT_SETTINGS,
DocPage,
Expand All @@ -17,7 +15,6 @@ import cn from 'bem-cn-lite';
import {updateBodyClassName} from '../utils';

import {getContent} from './data';

import './index.scss';

const layoutBlock = cn('Layout');
Expand Down
1 change: 0 additions & 1 deletion demo/src/Components/ErrorPage/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {ERROR_CODES, ErrorPage} from '@diplodoc/components';

const ErrorPageDemo = (args) => {
Expand Down
1 change: 0 additions & 1 deletion demo/src/Components/LeadingPage/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {useEffect} from 'react';

import {DocLeadingPage, DocLeadingPageData, Theme} from '@diplodoc/components';
import cn from 'bem-cn-lite';

Expand Down
1 change: 0 additions & 1 deletion demo/src/Components/Paginator/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {useState} from 'react';

import {Paginator as Component} from '@diplodoc/components';

const PaginatorDemo = () => {
Expand Down
1 change: 0 additions & 1 deletion demo/src/Components/SearchItem/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {SearchItem as Component} from '@diplodoc/components';

import data from './page.json';
Expand Down
10 changes: 6 additions & 4 deletions demo/src/Components/SearchPage/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, {useState} from 'react';

import {ISearchItem, SearchPage} from '@diplodoc/components';

import mockData from './data';

// eslint-disable-next-line no-console, @typescript-eslint/no-explicit-any
const log = (...message: any[]) => console.log(...message);

const SearchPageDemo = (args) => {
const isMobile = args['Mobile'];
const [page, setPage] = useState(1);
Expand All @@ -24,9 +26,9 @@ const SearchPageDemo = (args) => {
setItems(getItems(newPage, mockData));
}}
onSubmit={() => setItems(getItems(page, mockData))}
itemOnClick={(item) => console.log('Click on search result', item)}
irrelevantOnClick={(item) => console.log('Click on dislike button', item)}
relevantOnClick={(item) => console.log('Click on like button', item)}
itemOnClick={(item) => log('Click on search result', item)}
irrelevantOnClick={(item) => log('Click on dislike button', item)}
relevantOnClick={(item) => log('Click on like button', item)}
itemsPerPage={2}
totalItems={mockData.length}
/>
Expand Down
5 changes: 2 additions & 3 deletions demo/src/Components/SearchSuggest/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, {useState} from 'react';

import type {SearchProvider, SearchResult} from '@diplodoc/components';

import React, {useState} from 'react';
import {SearchSuggest as Component} from '@diplodoc/components';
import block from 'bem-cn-lite';

import data from './page.json';

import './index.scss';

const b = block('header');
Expand Down
1 change: 0 additions & 1 deletion src/components/BookmarkButton/BookmarkButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {Star, StarFill} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
1 change: 0 additions & 1 deletion src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import block from 'bem-cn-lite';

import {BreadcrumbItem} from '../../models';
Expand Down
1 change: 0 additions & 1 deletion src/components/ConsentPopup/ConsentPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {ConsentManager, ConsentMode, CookieConsent} from '@gravity-ui/components';

import {AnalyticsParams, useAnalytics} from '../../hooks';
Expand Down
2 changes: 0 additions & 2 deletions src/components/ContributorAvatars/Avatars/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, {BaseSyntheticEvent} from 'react';

import block from 'bem-cn-lite';

import {Contributor} from '../../../models';
import {AvatarData, AvatarSizes, PopupData} from '../models';
import {getUserIdentificator} from '../utils';

import '../ContributorAvatars.scss';

const b = block('dc-contributor-avatars');
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContributorAvatars/Avatars/Details.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {Link, Popup} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand All @@ -10,6 +9,7 @@ import {getName} from '../utils';

import Avatar from './Avatar';

// eslint-disable-next-line import/order
import '../ContributorAvatars.scss';

const b = block('dc-contributor-avatars');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, {BaseSyntheticEvent, Fragment, useRef, useState} from 'react';

import block from 'bem-cn-lite';

import {Contributor} from '../../../models';
import {AvatarSizes, PopupData} from '../models';

import Details from './Details';

// eslint-disable-next-line import/order
import '../ContributorAvatars.scss';

const b = block('dc-contributor-avatars');
Expand Down
2 changes: 0 additions & 2 deletions src/components/ContributorAvatars/ContributorAvatars.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {Fragment, ReactElement} from 'react';

import {Link} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand All @@ -10,7 +9,6 @@ import AvatarWithDescription from './Avatars/AvatarWithDescription';
import HiddenAvatars from './Avatars/HiddenAvatars';
import {AvatarData, AvatarSizes} from './models';
import {getName} from './utils';

import './ContributorAvatars.scss';

const b = block('dc-contributor-avatars');
Expand Down
1 change: 0 additions & 1 deletion src/components/Contributors/Contributors.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import block from 'bem-cn-lite';

import {useTranslation} from '../../hooks';
Expand Down
1 change: 0 additions & 1 deletion src/components/Control/Control.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {forwardRef, useCallback, useImperativeHandle, useRef} from 'react';

import {Button, ButtonProps, Popup, useDirection} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Controls/Controls.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useContext} from 'react';

import block from 'bem-cn-lite';

import {FeedbackSendData, Lang, SubscribeData, TextSizes, Theme} from '../../models';
Expand All @@ -18,6 +17,7 @@ import {
SinglePageControl,
} from './';

// eslint-disable-next-line import/order
import './Controls.scss';

const b = block('dc-controls');
Expand Down
1 change: 0 additions & 1 deletion src/components/Controls/ControlsLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {PropsWithChildren, createContext} from 'react';

import block from 'bem-cn-lite';

import {PopperPosition} from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {useContext} from 'react';

import cn from 'bem-cn-lite';

import {ControlsLayoutContext} from '../../ControlsLayout';
Expand Down
1 change: 0 additions & 1 deletion src/components/Controls/single-controls/EditControl.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useContext} from 'react';

import {Pencil} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useCallback, useContext, useEffect} from 'react';

import {SquareDashed, SquareDashedCircle} from '@gravity-ui/icons';

import {useTranslation} from '../../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {useCallback, useContext, useMemo, useRef} from 'react';

import {Globe} from '@gravity-ui/icons';
import {List, Popover} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
1 change: 0 additions & 1 deletion src/components/Controls/single-controls/PdfControl.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useContext} from 'react';

import {Icon} from '@gravity-ui/uikit';

import {useTranslation} from '../../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {ReactElement, useCallback, useContext, useRef, useState} from 'react';

import {Gear} from '@gravity-ui/icons';
import {Button, List, Popover, Switch, useDirection} from '@gravity-ui/uikit';
import cn from 'bem-cn-lite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useCallback, useContext} from 'react';

import {ChevronsCollapseToLine, ChevronsExpandToLines} from '@gravity-ui/icons';
import block from 'bem-cn-lite';

Expand Down
1 change: 0 additions & 1 deletion src/components/DocContentPage/DocContentPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import block from 'bem-cn-lite';

import {DEFAULT_SETTINGS} from '../../constants';
Expand Down
1 change: 0 additions & 1 deletion src/components/DocLayout/DocLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {PropsWithChildren, ReactElement} from 'react';

import block from 'bem-cn-lite';

import {Router, TocData} from '../../models';
Expand Down
1 change: 0 additions & 1 deletion src/components/DocLeadingPage/DocLeadingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import block from 'bem-cn-lite';

import {DEFAULT_SETTINGS} from '../../constants';
Expand Down
1 change: 0 additions & 1 deletion src/components/DocPage/DocPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {ReactPortal} from 'react';

import {Link, Xmark} from '@gravity-ui/icons';
import {Button, Icon} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
1 change: 0 additions & 1 deletion src/components/DocPageTitle/DocPageTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {PropsWithChildren} from 'react';

import block from 'bem-cn-lite';

import {StageLabel, StageType} from '../StageLabel';
Expand Down
1 change: 0 additions & 1 deletion src/components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {PropsWithChildren} from 'react';

import isEqual from 'lodash/isEqual';

import {ErrorPage} from '../ErrorPage';
Expand Down
1 change: 0 additions & 1 deletion src/components/ErrorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import {Button, Link} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Feedback/Feedback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {PropsWithChildren, useCallback, useEffect, useRef, useState} from 'react';

import block from 'bem-cn-lite';

import {usePopupState, useTranslation} from '../../hooks';
Expand All @@ -9,7 +8,6 @@ import DislikeControl from './controls/DislikeControl';
import DislikeVariantsPopup, {FormData} from './controls/DislikeVariantsPopup';
import LikeControl from './controls/LikeControl';
import SuccessPopup from './controls/SuccessPopup';

import './Feedback.scss';

const b = block('dc-feedback');
Expand Down
1 change: 0 additions & 1 deletion src/components/Feedback/controls/DislikeControl.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {forwardRef, memo, useContext} from 'react';

import {ThumbsDown, ThumbsDownFill} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
1 change: 0 additions & 1 deletion src/components/Feedback/controls/DislikeVariantsPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React, {
useRef,
useState,
} from 'react';

import {Button, Checkbox, Popup, TextArea, useDirection} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
4 changes: 2 additions & 2 deletions src/components/Feedback/controls/LikeControl.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {forwardRef, memo, useContext} from 'react';
import type {PopperPosition} from '../../../hooks';

import React, {forwardRef, memo, useContext} from 'react';
import {ThumbsUp, ThumbsUpFill} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

import type {PopperPosition} from '../../../hooks';
import {useTranslation} from '../../../hooks';
import {Control} from '../../Control';
import {ControlsLayoutContext} from '../../Controls/ControlsLayout';
Expand Down
1 change: 0 additions & 1 deletion src/components/Feedback/controls/SuccessPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {RefObject, memo, useContext, useMemo} from 'react';

import {Popup, useDirection} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
1 change: 0 additions & 1 deletion src/components/Mark/Mark.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import block from 'bem-cn-lite';

import './Mark.scss';
Expand Down
1 change: 0 additions & 1 deletion src/components/MiniToc/MiniToc.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useMemo} from 'react';

import block from 'bem-cn-lite';

import {useTranslation} from '../../hooks';
Expand Down
1 change: 0 additions & 1 deletion src/components/Paginator/Paginator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {ReactNode} from 'react';

import {ArrowLeft, ArrowRight} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
Expand Down
1 change: 0 additions & 1 deletion src/components/Scrollspy/Scrollspy.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {HTMLProps, ReactElement} from 'react';

import debounce from 'lodash/debounce';
import isEqual from 'lodash/isEqual';
import scrollIntoView from 'scroll-into-view-if-needed';
Expand Down
1 change: 0 additions & 1 deletion src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo} from 'react';

import {ChevronLeft, Xmark} from '@gravity-ui/icons';
import block from 'bem-cn-lite';
import {useHotkeys} from 'react-hotkeys-hook';
Expand Down
1 change: 0 additions & 1 deletion src/components/SearchBar/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {SyntheticEvent, useCallback, useEffect, useRef, useState} from 'react';

import throttle from 'lodash/throttle';

import {CLASSNAME, CLASSNAME_SELECTED, HIGHLIGHT_OPTIONS} from './constants';
Expand Down
1 change: 0 additions & 1 deletion src/components/SearchItem/SearchItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {memo, useState} from 'react';

import {Button} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
1 change: 0 additions & 1 deletion src/components/SearchPage/SearchPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {useRef, useState} from 'react';

import {Button, Loader, TextInput} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchSuggest/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {KeyboardEvent} from 'react';
import React, {forwardRef, memo} from 'react';

import React, {forwardRef, memo} from 'react';
import {TextInput, TextInputSize} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';

Expand Down
5 changes: 2 additions & 3 deletions src/components/SearchSuggest/Suggest.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import type {ReactNode} from 'react';
import React, {forwardRef, memo, useEffect} from 'react';
import type {SearchProvider, SearchSuggestItem} from './types';

import React, {forwardRef, memo, useEffect} from 'react';
import {List, ListItemData, Loader} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
import pick from 'lodash/pick';

import {useTranslation} from '../../hooks';

import type {SearchProvider, SearchSuggestItem} from './types';
import {useProvider} from './useProvider';

import './index.scss';

const b = block('dc-search-suggest');
Expand Down
Loading

0 comments on commit ca4071b

Please sign in to comment.