Skip to content

Commit

Permalink
feat: add unused imports plugin, remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoVan committed Mar 14, 2024
1 parent d9b981f commit 8bdb2d8
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ module.exports = {
'i18next',
'react-hooks',
'paths-fixes',
'unused-imports',
],
rules: {
'react/jsx-indent': [2, 4],
'react/jsx-indent-props': [2, 4],
'unused-imports/no-unused-imports': 'error',
indent: [2, 4],
'react/jsx-filename-extension': [
2,
Expand Down
1 change: 0 additions & 1 deletion config/build/buildWebpackConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import webpack from 'webpack';
import path from 'path';
import { BuildOptions } from './types/config';
import { buildPlugins } from './buildPlugins';
import { buildLoaders } from './buildLoaders';
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"ts-morph": "^16.0.0",
"@vitejs/plugin-react": "^2.1.0",
"vite": "^3.1.0",
"vite-plugin-svgr": "^2.2.1"
"vite-plugin-svgr": "^2.2.1",
"eslint-plugin-unused-imports": "^2.0.0"
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.0",
Expand Down
6 changes: 2 additions & 4 deletions src/app/providers/ThemeProvider/ui/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, {
FC, ReactNode, useMemo, useState,
} from 'react';
import { ThemeContext } from '../../../../shared/lib/context/ThemeContext';
import React, { ReactNode, useMemo, useState } from 'react';
import { ThemeContext } from '@/shared/lib/context/ThemeContext';
import { Theme } from '@/shared/const/theme';
import { LOCAL_STORAGE_THEME_KEY } from '@/shared/const/localstorage';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next';
import { memo, useCallback, useMemo } from 'react';
import { memo, useMemo } from 'react';
import { classNames } from '@/shared/lib/classNames/classNames';
import { Select, SelectOption } from '@/shared/ui/Select';
import { SortOrder } from '@/shared/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo, useCallback, useMemo } from 'react';
import { memo, useCallback } from 'react';
import { useSelector } from 'react-redux';
import { useTranslation } from 'react-i18next';
import { classNames } from '@/shared/lib/classNames/classNames';
Expand All @@ -8,14 +8,13 @@ import { Input } from '@/shared/ui/Input';
import { Card } from '@/shared/ui/Card';
import { SortOrder } from '@/shared/types';
import { useDebounce } from '@/shared/lib/hook/useDebounce/useDebounce';
import { TabItem } from '@/shared/ui/Tabs';
import { ArticleTypeTabs } from '@/features/ArticleTypeTabs';
import { fetchArticlesList } from '../../model/services/fetchArticlesList/fetchArticlesList';
import {
ArticleSortField,
ArticleSortSelector, ArticleType,
ArticleView,
} from '../../../../entities/Article';
} from '@/entities/Article';
import { articlesPageActions } from '../../model/slices/articlesPageSlice';
import {
getArticlesPageOrder,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/lib/hook/useInfiniteScroll/useInfiniteScroll.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MutableRefObject, useEffect, useRef } from 'react';
import { MutableRefObject, useEffect } from 'react';

export interface UseInfiniteScrollOption {
callback?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ButtonHTMLAttributes, FC, memo, ReactNode,
ButtonHTMLAttributes, memo, ReactNode,
} from 'react';
import { classNames, Mods } from '@/shared/lib/classNames/classNames';
import cls from './Button.module.scss';
Expand Down
5 changes: 3 additions & 2 deletions src/shared/ui/Popups/ui/ListBox/ListBox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';

import { action, actions, ActionDisplay } from '@storybook/addon-actions';
import { Country } from '../../../../../entities/Country';
import { action } from '@storybook/addon-actions';
// eslint-disable-next-line paths-fixes/layer-imports
import { Country } from '@/entities/Country';
import { ListBox } from './ListBox';

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, memo, useMemo } from 'react';
import { ChangeEvent, useMemo } from 'react';
import { classNames, Mods } from '@/shared/lib/classNames/classNames';
import cls from './Select.module.scss';

Expand Down
10 changes: 4 additions & 6 deletions src/shared/ui/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { useTranslation } from 'react-i18next';
import { CSSProperties, memo } from 'react';
import { classNames } from '@/shared/lib/classNames/classNames';
import cls from './Skeleton.module.scss';

interface SkeletonProps {
className?: string;
height?: string | number;
width?: string | number;
border?: string;
className?: string;
height?: string | number;
width?: string | number;
border?: string;
}

export const Skeleton = memo((props: SkeletonProps) => {
Expand All @@ -25,7 +24,6 @@ export const Skeleton = memo((props: SkeletonProps) => {

};

const { t } = useTranslation();
return (
<div
style={styles}
Expand Down

0 comments on commit 8bdb2d8

Please sign in to comment.