Skip to content

Commit 9a96e4c

Browse files
authored
feat(vite): Update return type of vite plugin (#728)
1 parent b0f22d1 commit 9a96e4c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/vite-plugin/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
createComponentNameAnnotateHooks,
1111
Logger,
1212
} from "@sentry/bundler-plugin-core";
13-
import { UnpluginOptions } from "unplugin";
13+
import { UnpluginOptions, VitePlugin } from "unplugin";
1414

1515
function viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {
1616
return {
@@ -73,8 +73,7 @@ const sentryUnplugin = sentryUnpluginFactory({
7373
bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,
7474
});
7575

76-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
77-
export const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;
76+
export const sentryVitePlugin: (options?: Options) => VitePlugin[] = sentryUnplugin.vite;
7877

7978
export type { Options as SentryVitePluginOptions } from "@sentry/bundler-plugin-core";
8079
export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";

packages/vite-plugin/test/public-api.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VitePlugin } from "unplugin";
21
import { sentryVitePlugin } from "../src";
32

43
test("Vite plugin should exist", () => {
@@ -16,7 +15,7 @@ describe("sentryVitePlugin", () => {
1615
authToken: "test-token",
1716
org: "test-org",
1817
project: "test-project",
19-
}) as VitePlugin[];
18+
});
2019

2120
expect(Array.isArray(plugins)).toBe(true);
2221

0 commit comments

Comments
 (0)