40 examples

Unused import

Imported module never utilized, causing unnecessary dependencies.

[ FAQ1 ]

What is an unused import?

An unused import occurs when a file or module imports dependencies that aren't referenced or utilized anywhere within that file's logic. Such unnecessary imports clutter the codebase, reduce readability, and can lead to slower build or compilation times. Unused imports are commonly introduced during development or refactoring and can be automatically detected by static analysis tools and linters such as ESLint, which flag these imports as unnecessary or "dead."
[ FAQ2 ]

How to remove unused imports

To remove unused imports, regularly run static analysis or linting tools like ESLint to automatically identify and highlight these redundant dependencies. Utilize automated code formatters or IDE plugins that can quickly detect and remove unused imports during file saving or code review. Perform periodic manual reviews and refactoring sessions to maintain a clean, efficient codebase. Keeping imports minimal and relevant helps enhance readability, simplifies maintenance, and improves build performance.
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
# Add nodes
graph.add_node("init_state_node", init_state_node)
- graph.add_node("signs_node", signs_node)
- graph.add_node("parking_node", parking_node)
- graph.add_node("lot_requirements_node", lot_requirements_node)
- graph.add_node("building_placement_node", building_placement_node)
graph.add_node("building_requirements_node", building_requirements_node)
- graph.add_node("landscaping_requirements_node", landscaping_requirements_node)
+
+ # graph.add_node("signs_node", signs_node)
+ # graph.add_node("parking_node", parking_node)
+ # graph.add_node("lot_requirements_node", lot_requirements_node)
+ # graph.add_node("building_placement_node", building_placement_node)
+ # graph.add_node("landscaping_requirements_node", landscaping_requirements_node)
+ # graph.add_node("permitted_uses_node", permitted_uses_node)
graph.add_node("combine_results_node", combine_results_node)
Greptile
greptile
style: Most query nodes are commented out but still imported and referenced in the code. Consider removing unused imports if these nodes will remain disabled.
suggested fix
+ graph.add_node("building_requirements_node", building_requirements_node)
+ graph.add_node("combine_results_node", combine_results_node)
diff block
+import os
+from typing import Optional
Greptile
greptile
style: Optional import is not used anywhere in the code
suggested fix
+from typing import Optional # Remove unused import
diff block
// This file is autogenerated - Please do not edit
// ===============================================
-export enum FileDownloadApiApiKeys {
-}
+export enum FileDownloadApiApiKeys {}
export class FileDownloadApi {
- protected _basePath = defaultBasePath;
- protected _defaultHeaders : any = {};
- protected _useQuerystring : boolean = false;
-
- protected authentications = {
- 'default': <Authentication>new VoidAuth(),
- 'API_Key': new HttpBearerAuth(),
- }
-
- protected interceptors: Interceptor[] = [];
-
- constructor(basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- set defaultHeaders(defaultHeaders: any) {
- this._defaultHeaders = defaultHeaders;
+ protected _basePath = defaultBasePath;
+ protected _defaultHeaders: any = {};
+ protected _useQuerystring: boolean = false;
+
+ protected authentications = {
+ default: <Authentication>new VoidAuth(),
+ API_Key: new HttpBearerAuth(),
+ };
Greptile
greptile
style: Authentication setup only includes VoidAuth and HttpBearerAuth, but imports unused HttpBasicAuth, ApiKeyAuth, and OAuth. Consider removing unused imports.
diff block
+import { definePreviewAddon } from 'storybook/internal/csf';
import { definePreview } from 'storybook/internal/preview-api';
Greptile
greptile
style: Both definePreview and definePreviewAddon are imported but only definePreviewAddon is used. Remove unused import.
suggested fix
import { definePreviewAddon } from 'storybook/internal/csf';
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
import { S3Client } from "../../shared/db/s3Client";
import { Provider } from "../../../packages/llm-mapper/types";
import { HeliconeRequest } from "../../../packages/llm-mapper/types";
+import {
+ clickhousePriceCalc,
+ clickhousePriceCalcNonAggregated,
Greptile
greptile
style: clickhousePriceCalc is imported but not used in this file. Consider removing the unused import.
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 redundant
diff block
+// import React from 'react';
+// import { Spinner } from '@inkjs/ui';
+// import figureSet from 'figures';
+// import { Box, Text } from 'ink';
+// import { coerce, satisfies } from 'semver';
+// import { ACTIONS } from '..';
+// import { Confirm } from '../../components/Confirm';
Greptile
greptile
style: All these imports are commented out but referenced in the commented render code below. Either implement the render functionality or remove unused imports.
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding prettier options instead of using prettierConfigPath removes configurability and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
import { Button } from "@/components/ui/button";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
+ faCheck,
faChevronLeft,
faChevronRight,
+ faCopy,
} from "@fortawesome/pro-regular-svg-icons";
import CopyButton from "@/components/general/CopyButton";
Greptile
greptile
style: CopyButton component is imported but no longer used after the refactor. Remove unused import.
diff block
+import type { Args, StoryContext } from '@storybook/csf';
+
+import { SNIPPET_RENDERED } from '../../../docs-tools';
+import { addons, useEffect, useRef, useState } from '../addons';
Greptile
greptile
style: Remove unused imports: useEffect, useRef, useState.
suggested fix
+import { addons } from '../addons';
diff block
-import { Button, type ButtonProps } from "@rivet-gg/components";
-import { Icon, faPlus } from "@rivet-gg/icons";
-import { useNavigate } from "@tanstack/react-router";
+import type { ButtonProps } from "@rivet-gg/components";
Greptile
greptile
style: ButtonProps type is still imported but never used since component returns null. Remove unused import.
suggested fix
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding prettier options instead of using prettierConfigPath removes flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
diff block
+import os
+from typing import Optional
Greptile
greptile
style: Optional is imported but never used in the code
suggested fix
+from typing import Optional # Remove unused import
diff block
+import { Action, ActionPanel, Icon, LocalStorage, showToast, Toast, getPreferenceValues, useNavigation } from "@raycast/api"; // Added getPreferenceValues, useNavigation
+import { Dispatch, SetStateAction } from "react";
+import { ActionOpenPreferences } from "./action-open-preferences";
+import { Workflow } from "../types/types";
+import { activateWorkflowAPI } from "../utils/n8n-api-utils";
+import { LocalStorageKey } from "../utils/constants";
+import { getWebhookDetails } from "../utils/workflow-utils"; // Import webhook helper
+import WebhookTriggerForm from "./WebhookTriggerForm"; // Import the new form component (will create next)
+
+// Define preferences needed here
+interface Preferences {
+ instanceUrl: string;
+ // apiKey is not needed directly here, but good practice to define full expected prefs
+ apiKey: string;
+ rememberFilter: boolean;
+}
+
+export function ActionOnWorkflow(props: {
+ workflow: Workflow;
+ setRefresh: Dispatch<SetStateAction<number>>;
+ setRefreshDetail: Dispatch<SetStateAction<number>>;
+ showDetail: boolean;
+}) {
+ const { workflow, setRefresh, setRefreshDetail, showDetail } = props;
+ const { instanceUrl } = getPreferenceValues<Preferences>();
+ const { push } = useNavigation();
Greptile
greptile
useNavigation hook imported but never used - push is destructured but not utilized
suggested fix
+ // const { push } = useNavigation(); // Removing unused import
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding prettier options instead of using prettierConfigPath removes flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding prettier options instead of using prettierConfigPath removes configurability and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
+import { Payables, PayableDetails, Receivables, ReceivableDetails } from '@mercoa/react'
+import { toast } from 'react-toastify'
Greptile
greptile
style: react-toastify is imported but never used in the examples. Consider removing this unused import.
suggested fix
diff block
+# 🚀 Pull Request Title
+
+_A short and clear title that describes what this PR does._
+
+Example:
+> Add Retry, Cache, and Logging Features to API Service
+
## Description
-Please include a summary of the changes and the related issues.
+Please describe **what you did**, and **why**.
-## Type of Change
+- What problem or feature does this PR address?
+- What changes were made?
+- Why are these changes useful?
+
+Example:
+> This PR adds advanced features to the API request system:
+>
+> - Retry failed requests with exponential delay
+> - Cache GET responses with TTL
+> - Log all requests and responses
+> - Allow cancelling requests
+>
+> These features improve reliability, performance, and debugging.
+
+## What Was Changed
+
+### Major Changes
+
+Example:
+> Here are the major changes in that his PR adds
+>
+> - New `CookieManagement` class for cookie handling
+> - Cancel requests using `AbortController`
+> - Automatically inject tenant and organization headers
+
+### Minor Changes
+
+Example:
+> Here are the minor changes in that his PR adds
+>
+> - Update `tast-status` component style
+> - Work on the theme toggler
+> - Remove unused imports
+
+## How to Test This PR
+
+Please explain clearly how to test the changes locally:
+
+Example:
+>
+> 1. Run the app with `yarn web:dev`
+> 2. Open the browser at `http://localhost:3030`
+> 3. Try navigating to a page that uses API calls (e.g., `/tasks`)
+> 4. Check:
+ >
+ > - Logs in the console
+ > - Retry works on failed requests
+ > - Cache works on repeated GET requests
+ > - Errors are handled properly
+ > - Cancelling navigation cancels requests
+ > - Remove unused imports
Greptile
greptile
style: 'Remove unused imports' appears to be duplicated from the Minor Changes section and doesn't fit in the testing checklist
suggested fix
> - Cancelling navigation cancels requests
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
+# 🚀 Pull Request Title
+
+_A short and clear title that describes what this PR does._
+
+Example:
+> Add Retry, Cache, and Logging Features to API Service
+
## Description
-Please include a summary of the changes and the related issues.
+Please describe **what you did**, and **why**.
-## Type of Change
+- What problem or feature does this PR address?
+- What changes were made?
+- Why are these changes useful?
+
+Example:
+> This PR adds advanced features to the API request system:
+>
+> - Retry failed requests with exponential delay
+> - Cache GET responses with TTL
+> - Log all requests and responses
+> - Allow cancelling requests
+>
+> These features improve reliability, performance, and debugging.
+
+## What Was Changed
+
+### Major Changes
+
+Example:
+> Here are the major changes in that his PR adds
+>
+> - New `CookieManagement` class for cookie handling
+> - Cancel requests using `AbortController`
+> - Automatically inject tenant and organization headers
+
+### Minor Changes
+
+Example:
+> Here are the minor changes in that his PR adds
+>
+> - Update `tast-status` component style
+> - Work on the theme toggler
+> - Remove unused imports
+
+## How to Test This PR
+
+Please explain clearly how to test the changes locally:
+
+Example:
+>
+> 1. Run the app with `yarn web:dev`
+> 2. Open the browser at `http://localhost:3030`
+> 3. Try navigating to a page that uses API calls (e.g., `/tasks`)
+> 4. Check:
+ >
+ > - Logs in the console
+ > - Retry works on failed requests
+ > - Cache works on repeated GET requests
+ > - Errors are handled properly
+ > - Cancelling navigation cancels requests
+ > - Remove unused imports
Greptile
greptile
logic: 'Remove unused imports' is duplicated in the testing checklist but doesn't belong there as it's not something to test
suggested fix
> - Cancelling navigation cancels requests
diff block
+# 🚀 Pull Request Title
+
+_A short and clear title that describes what this PR does._
+
+Example:
+> Add Retry, Cache, and Logging Features to API Service
+
## Description
-Please include a summary of the changes and the related issues.
+Please describe **what you did**, and **why**.
-## Type of Change
+- What problem or feature does this PR address?
+- What changes were made?
+- Why are these changes useful?
+
+Example:
+> This PR adds advanced features to the API request system:
+>
+> - Retry failed requests with exponential delay
+> - Cache GET responses with TTL
+> - Log all requests and responses
+> - Allow cancelling requests
+>
+> These features improve reliability, performance, and debugging.
+
+## What Was Changed
+
+### Major Changes
+
+Example:
+> Here are the major changes in that his PR adds
+>
+> - New `CookieManagement` class for cookie handling
+> - Cancel requests using `AbortController`
+> - Automatically inject tenant and organization headers
+
+### Minor Changes
+
+Example:
+> Here are the minor changes in that his PR adds
+>
+> - Update `tast-status` component style
+> - Work on the theme toggler
+> - Remove unused imports
+
+## How to Test This PR
+
+Please explain clearly how to test the changes locally:
+
+Example:
+>
+> 1. Run the app with `yarn web:dev`
+> 2. Open the browser at `http://localhost:3030`
+> 3. Try navigating to a page that uses API calls (e.g., `/tasks`)
+> 4. Check:
+ >
+ > - Logs in the console
+ > - Retry works on failed requests
+ > - Cache works on repeated GET requests
+ > - Errors are handled properly
+ > - Cancelling navigation cancels requests
+ > - Remove unused imports
Greptile
greptile
logic: 'Remove unused imports' is misplaced in the testing checklist - it belongs in development tasks, not testing steps
diff block
+import { useEffect, useState } from 'react';
+
+import noImage from '../../../../../images/images/noimage.svg';
+import * as favStyles from '../imagesScreen/components/folderItem/FolderItem.module.scss';
+import IExplorerData from '@/app/interfaces/IExplorerData';
+import AppSpinner from '@/content/components/containers/appSpinner/AppSpinner';
+import DashboardCard from '@/content/panel/components/containers/dashboardLayout/elements/DashboardCard';
+import { RootStateOrAny, useDispatch, useSelector } from 'react-redux';
+import { IDbFolderData } from '@/app/interfaces/IEditorImage';
+import { IUser } from '@/app/interfaces/IUserData';
+import classNames from 'classnames';
+import * as styles from '../imagesScreen/pages/myImages/MyImages.module.scss';
+import useItemsFilter from '@/content/panel/hooks/useItemsFilter';
+import SCHeader from '@/content/panel/shared/SCHeader/SCHeader';
+import { ItemOrderEnum } from '../imagesScreen/pages/shared/enums/itemOrderEnum';
+import useItemOrder from '../imagesScreen/pages/shared/hooks/useItemOrder';
+import { ItemTypeEnum } from '../imagesScreen/pages/shared/enums/itemTypeEnum';
+import useFavoritesFolders from '../../hooks/useFavoritesFolders';
+import { Menu } from 'antd';
+import AppSvg from '@/content/components/elements/AppSvg';
+import {
+ addImageFolderToFavsAPI,
+ addVideoFolderToFavsAPI,
+} from '@/app/services/api/image';
+import FolderHeader from '../imagesScreen/components/folderItem/FolderHeader';
+
+const FavoritesPage: React.FC = () => {
+ const {
+ favoritesVideos,
+ favoritesImages,
+ setFavoritesImages,
+ setFavoritesVideos,
+ refetch,
+ loader,
+ } = useFavoritesFolders();
+
+ const [isDropdownVisible, setIsDropdownVisible] = useState('');
+
+ const user: IUser = useSelector((state: RootStateOrAny) => state.auth.user);
+ const explorerData: IExplorerData = useSelector(
+ (state: RootStateOrAny) => state.panel.explorerData,
+ );
+
+ const itemOrder: ItemOrderEnum = useSelector(
+ (state: RootStateOrAny) => state.panel.screenshotsItemOrder,
+ );
+ const { itemData } = useItemOrder(
+ explorerData.files,
+ itemOrder,
+ ItemTypeEnum.images,
+ );
+ const { filter, onFilterChange } = useItemsFilter(itemData);
+
+ // useGetExplorerDataListener(); // TODO fix
+
+ const moreMenu = (value: 'images' | 'videos', folderId: string) => (
+ <Menu
+ className={classNames(favStyles.gradientBackground)}
+ style={{ padding: 5 }}
+ onClick={(e) => {
+ e.domEvent.stopPropagation();
+ setIsDropdownVisible('');
+ }}
+ >
+ <Menu.Item
+ style={{ margin: 10 }}
+ className="tw-bg-white tw-rounded-xl"
+ icon={<AppSvg path={'/common/star.svg'} size="18px" />}
+ key="menu_item_add_to_favs"
+ onClick={async () => {
+ if (value == 'videos') {
+ await addVideoFolderToFavsAPI(folderId);
+ setFavoritesVideos((prev) => prev.filter((x) => x.id !== folderId));
+ refetch();
+ } else {
+ await addImageFolderToFavsAPI(folderId);
+ setFavoritesImages((prev) => prev.filter((x) => x.id !== folderId));
+ refetch();
+ }
+ }}
+ //onClick={(e) => addToFavs()}
+ >
+ <span className="tw-text-base tw-font-semibold">
+ Remove from favorites
+ </span>
+ </Menu.Item>
+ </Menu>
+ );
+
+ return (
+ <>
+ <section
+ className={styles.mainSection}
+ style={{ justifyContent: 'flex-start', backgroundColor: 'white' }}
+ >
+ <SCHeader
+ filterValue={filter}
+ onFilterChange={(e) => onFilterChange(e.target.value)}
+ userPhotoURL={user?.photoURL}
+ />
+
+ <DashboardCard className={styles.foldersDashboardCard}>
+ <div>
+ <div className={styles.pageHeadingWrapper}>
+ <h1 className={styles.favoriteHeading}>Favorites</h1>
+ </div>
+ </div>
+ <>
+ <div className={styles.foldersHeadingContainer}>
+ <h3 className={styles.heading}>Images Folders</h3>
+ </div>
+ {favoritesImages.length ? (
+ <div className="tw-h-fit tw-flex tw-overflow-y-auto">
+ <div
+ className={styles.foldersFavourites}
+ style={{
+ display: 'flex',
+ gap: '20px',
+ marginLeft: '28px',
+ flexWrap: 'wrap',
+ }}
+ id="scrollableDiv"
+ >
+ {favoritesImages.map((folder: IDbFolderData) => (
+ <div
+ key={folder.id}
+ className={classNames(
+ favStyles.mainWrapper,
+ isDropdownVisible == folder.id && favStyles.active,
+ )}
+ style={{ height: '58px' }}
+ onClick={(e: any) => {
+ if (e.target.localName === 'ul') return;
+ }}
+ >
+ <FolderHeader
+ moreMenu={moreMenu('images', folder.id)}
+ isFavorite={true}
+ folder={folder}
+ isDropdownVisible={isDropdownVisible == folder.id}
+ onVisibleChange={(visibility) =>
+ setIsDropdownVisible(
+ visibility == true ? folder.id : '',
+ )
+ }
+ />
+ </div>
+ ))}
+ </div>
+ </div>
+ ) : (
+ <div className="tw-h-[calc(50vh-206px)] tw-flex tw-justify-center tw-items-center ">
+ <div className="tw-flex tw-flex-col tw-items-center">
+ <img
+ src={noImage}
+ style={{ width: '100px', height: '100px' }}
+ alt="no-image"
+ />
+ <h1 className="tw-text-xl tw-font-bold tw-text-center">
+ No Favourites Images Folders found
+ </h1>
+ </div>
+ </div>
+ )}
+ <div className={styles.pageHeadingWrapper}></div>
+ <div className="tw-bg-white tw-flex tw-flex-grow tw-flex-col">
+ <div className={styles.foldersHeadingContainer}>
+ <h3 className={styles.heading}>Videos Folders</h3>
+ </div>
+ {favoritesVideos.length ? (
+ <div className="tw-h-fit tw-overflow-y-auto">
+ <div
+ className={classNames(styles.foldersFavourites, 'tw-flex')}
+ style={{
+ display: 'flex',
+ gap: '20px',
+ marginLeft: '28px',
+ flexWrap: 'wrap',
+ }}
+ id="scrollableDiv"
+ >
+ {/* THE START */}
+ <>
+ {favoritesVideos.map((folder: IDbFolderData) => (
+ <div
+ key={folder.id}
+ className={classNames(
+ favStyles.mainWrapper,
+ isDropdownVisible == folder.id && favStyles.active,
+ )}
+ style={{ height: '58px' }}
+ onClick={(e: any) => {
+ if (e.target.localName === 'ul') return;
+ }}
+ >
+ <FolderHeader
+ moreMenu={moreMenu('videos', folder.id)}
+ isFavorite={true}
+ folder={folder}
+ isDropdownVisible={isDropdownVisible == folder.id}
+ onVisibleChange={(visibility) =>
+ setIsDropdownVisible(
+ visibility == true ? folder.id : '',
+ )
+ }
+ />
+ </div>
+ ))}
+ </>
+
+ {/* THE END*/}
+ </div>
+ </div>
+ ) : (
+ <div className="tw-h-[calc(50vh-206px)] tw-flex tw-justify-center tw-items-center ">
+ <div className="tw-flex tw-flex-col tw-items-center">
+ <img
+ src={noImage}
+ width={100}
+ height={100}
+ alt="no-image"
+ />
+ <h1 className="tw-text-xl tw-font-bold tw-text-center">
+ No Favorites Videos Folders found
+ </h1>
+ </div>
+ </div>
+ )}
+ </div>
+ </>
+ </DashboardCard>
+ </section>
+
+ {/* <AppSpinner show={loader} /> */}
Greptile
greptile
style: Either implement the loading state with AppSpinner or remove the commented code and unused import
diff block
+"""
+Unit tests for the file_utils module.
+"""
+
+import os
+from pathlib import Path
+import pytest
+from unittest.mock import patch, mock_open, MagicMock, call, Mock
Greptile
greptile
style: Several mock imports are unused (patch, mock_open, MagicMock, call, Mock). Remove unused imports.
suggested fix
+from unittest.mock import Mock
diff block
+import React, { useState } from "react";
+import {
+ Action,
+ ActionPanel,
+ Form,
+ showToast,
+ Toast,
+ // useNavigation,
+ // LocalStorage,
+ // Detail
Greptile
greptile
style: Remove commented out unused imports
suggested fix
diff block
+import { Tag } from "@/components/tag";
Greptile
greptile
logic: The Tag component is imported but never used in this file. Either remove the unused import or utilize the Tag component as done in other _meta files for consistency.
suggested fix
diff block
use uuid::Uuid;
use crate::dashboards::types::{BusterShareIndividual, DashboardCollection};
-use crate::metrics::get_metric_handler;
+use crate::metrics::{get_metric_for_dashboard_handler, get_metric_handler};
Greptile
greptile
style: Importing both get_metric_handler and get_metric_for_dashboard_handler but only using the latter. Remove unused import.
suggested fix
+use crate::metrics::{get_metric_for_dashboard_handler};
diff block
+import i18n from "i18next";
+import k from "./../i18n/keys";
Greptile
greptile
style: The i18next library and translation keys are imported but not used anywhere in this file. Consider either implementing translations where needed or removing these unused imports.
suggested fix
diff block
+import i18n from "i18next";
+import k from "./../../../i18n/keys";
Greptile
greptile
logic: The i18next library is imported but not used anywhere in the component. This creates unused imports which should be removed or utilized.
suggested fix
+import { FiCheck, FiChevronDown, FiXCircle } from "react-icons/fi";
diff block
"use client";
+import i18n from "i18next";
+import k from "./../../i18n/keys";
Greptile
greptile
logic: i18n is imported but not used anywhere in this component. Consider either implementing the translations or removing the unused import.
suggested fix
diff block
+import i18n from "i18next";
+import k from "./../../../i18n/keys";
Greptile
greptile
logic: The i18next and translation keys are imported but never used in the component. This creates unused imports which should either be utilized or removed.
suggested fix
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
diff block
+import React, { useState } from 'react';
+import { ArrowLeft, Info, Settings } from 'lucide-react';
Greptile
greptile
syntax: Remove unused import 'Info'.
suggested fix
+import { ArrowLeft, Settings } from 'lucide-react';
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
style: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
+import { Clipboard, Detail, ActionPanel, Action, showToast, ToastStyle } from "@raycast/api";
+import { useTonConnect } from "./useTonConnect";
+// import TonWeb from "tonweb";
Greptile
greptile
style: Remove commented out unused import
suggested fix
diff block
.sync('**/*.js', {ignore: '**/node_modules/**'})
.filter(f => !onlyChanged || changedFiles.has(f));
-if (!files.length) {
- return;
-}
-
files.forEach(file => {
- const options = prettier.resolveConfig.sync(file, {
- config: prettierConfigPath,
- });
+ const options = {
+ semi: true,
+ singleQuote: true,
+ };
Greptile
greptile
logic: Hardcoding Prettier options instead of using prettierConfigPath removes configuration flexibility and makes the unused import on line 17 dead code
suggested fix
+ const options = require(prettierConfigPath);
diff block
+import type { Args, StoryContext } from '@storybook/csf';
+
+import { SNIPPET_RENDERED } from '../../../docs-tools';
+import { addons, useEffect, useRef, useState } from '../addons';
Greptile
greptile
style: Remove unused imports (useEffect, useRef, useState) to clean up the code.
suggested fix
+import { addons } from '../addons';