Skip to content

Commit

Permalink
chore: Remove unnecssary 'Omit' types
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Mar 31, 2024
1 parent 7e37e11 commit db57c8e
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/core/builders/vite/plugins/bundleAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import path from 'node:path';

let increment = 0;

export function bundleAnalysis(
config: Omit<ResolvedConfig, 'builder'>,
): vite.Plugin {
export function bundleAnalysis(config: ResolvedConfig): vite.Plugin {
return visualizer({
template: 'raw-data',
filename: path.resolve(
Expand Down
2 changes: 1 addition & 1 deletion src/core/builders/vite/plugins/cssEntrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getEntrypointBundlePath } from '~/core/utils/entrypoints';
*/
export function cssEntrypoints(
entrypoint: Entrypoint,
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
): vite.Plugin {
return {
name: 'wxt:css-entrypoint',
Expand Down
4 changes: 2 additions & 2 deletions src/core/builders/vite/plugins/devHtmlPrerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let reactRefreshPreamble = '';
* Pre-renders the HTML entrypoints when building the extension to connect to the dev server.
*/
export function devHtmlPrerender(
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
server: WxtDevServer | undefined,
): vite.PluginOption {
const htmlReloadId = '@wxt/reload-html';
Expand Down Expand Up @@ -133,7 +133,7 @@ export function devHtmlPrerender(
}

export function pointToDevServer(
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
server: WxtDevServer,
id: string,
document: Document,
Expand Down
2 changes: 1 addition & 1 deletion src/core/builders/vite/plugins/devServerGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ResolvedConfig, WxtDevServer } from '~/types';
* Defines global constants about the dev server. Helps scripts connect to the server's web socket.
*/
export function devServerGlobals(
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
server: WxtDevServer | undefined,
): Plugin {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/core/builders/vite/plugins/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { fetchCached } from '~/core/utils/network';
* @example
* import "url:https://google-tagmanager.com/gtag?id=XYZ";
*/
export function download(config: Omit<ResolvedConfig, 'builder'>): Plugin {
export function download(config: ResolvedConfig): Plugin {
return {
name: 'wxt:download',
resolveId(id) {
Expand Down
4 changes: 1 addition & 3 deletions src/core/builders/vite/plugins/excludeBrowserPolyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import type * as vite from 'vite';
* `webextension-polyfill` module to a virtual module and exporting the `chrome` global from the
* virtual module.
*/
export function excludeBrowserPolyfill(
config: Omit<ResolvedConfig, 'builder'>,
): vite.Plugin {
export function excludeBrowserPolyfill(config: ResolvedConfig): vite.Plugin {
const virtualId = 'virtual:wxt-webextension-polyfill-disabled';

return {
Expand Down
4 changes: 1 addition & 3 deletions src/core/builders/vite/plugins/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import type * as vite from 'vite';
import { ResolvedConfig } from '~/types';
import { getGlobals } from '~/core/utils/globals';

export function globals(
config: Omit<ResolvedConfig, 'builder'>,
): vite.PluginOption {
export function globals(config: ResolvedConfig): vite.PluginOption {
return {
name: 'wxt:globals',
config() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/builders/vite/plugins/multipageMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { normalizePath } from '~/core/utils/paths';
*/
export function multipageMove(
entrypoints: Entrypoint[],
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
): vite.Plugin {
return {
name: 'wxt:multipage-move',
Expand Down
4 changes: 1 addition & 3 deletions src/core/builders/vite/plugins/tsconfigPaths.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ResolvedConfig } from '~/types';
import type * as vite from 'vite';

export function tsconfigPaths(
config: Omit<ResolvedConfig, 'builder'>,
): vite.Plugin {
export function tsconfigPaths(config: ResolvedConfig): vite.Plugin {
return {
name: 'wxt:aliases',
async config() {
Expand Down
4 changes: 1 addition & 3 deletions src/core/builders/vite/plugins/unimport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const ENABLED_EXTENSIONS = new Set([
/**
* Inject any global imports defined by unimport
*/
export function unimport(
config: Omit<ResolvedConfig, 'builder'>,
): vite.PluginOption {
export function unimport(config: ResolvedConfig): vite.PluginOption {
const options = config.imports;
if (options === false) return [];

Expand Down
2 changes: 1 addition & 1 deletion src/core/builders/vite/plugins/webextensionPolyfillMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ResolvedConfig } from '~/types';
* `npm list` and inline them automatically.
*/
export function webextensionPolyfillMock(
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
): vite.PluginOption {
return {
name: 'wxt:testing-inline-deps',
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils/globals.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ResolvedConfig } from '~/types';

export function getGlobals(
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
): Array<{ name: string; value: any; type: string }> {
return [
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function isOnline(): Promise<boolean> {
*/
export async function fetchCached(
url: string,
config: Omit<ResolvedConfig, 'builder'>,
config: ResolvedConfig,
): Promise<string> {
let content: string = '';

Expand Down

0 comments on commit db57c8e

Please sign in to comment.