-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Versions
grit 0.1.1
Steps to reproduce
The following query behaves weirdly:
pnpm grit apply --dry-run '`$a as $b` => `$a`'
I want to use it to remove typecasts in the code.
It does correctly match a bunch of typecasts, but then it also matches a couple of weird cases:
./src/components/dialog/NewRequestDialog.tsx
import { useTranslation } from "@/i18n/client";
import { api } from "@/trpc/react";
import type { ExtendedFolder } from "@/types/types";
-import { type Folder, Priority } from "@prisma/client";
+import { Folder, Priority } from "@prisma/client";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { FoldersAccordion } from "../FoldersAccordion";
</>
)}
<FoldersAccordion
- dataRoomId={dataRoomId as string}
+ dataRoomId={dataRoomId}
folders={nestedFolders[""] || []}
subFoldersMap={nestedFolders}
onClickFolderCallback={handleSelectFolder}
It correctly tries to remove the as string
, but then it also removes the type
from my import statement?
And then it shows me a lot of empty diffs:
./src/components/queries/@questions/replySideBar/ReplyCard.tsx
./src/components/illustrations/book-demo/book-demo.tsx
./src/components/task-manager/assign-tasks/TaskItemCard.tsx
./src/components/queries/@questions/overviewSideBar/OverviewComponent.tsx
./src/server/api/services/request/request.service.ts
} from "@/access/server/accessItemHelpers";
import type { Context } from "@/server/context";
import {
- type AdditionalRequestData,
- type ExtendedRequest,
+ AdditionalRequestData,
+ ExtendedRequest,
ItemType,
- type SearchResultEntry,
- type SideBarInfo,
...
Additional context
Metadata
Metadata
Assignees
Labels
No labels