From 15cb64a7521d8b809ec5b4a1f6162c42132b67a3 Mon Sep 17 00:00:00 2001 From: sapphi-red Date: Mon, 31 Oct 2022 21:49:54 +0900 Subject: [PATCH] chore: remove non used type definitions --- packages/vite/src/node/plugins/css.ts | 2 + packages/vite/src/types/shims.d.ts | 55 --------------------------- 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index ad46e5ba738f37..dd3c99a2e00c3f 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -895,6 +895,8 @@ async function compileCSS( postcssPlugins.unshift( (await import('postcss-modules')).default({ ...modulesOptions, + // TODO: convert null to undefined (`null` should be removed from `CSSModulesOptions.localsConvention`) + localsConvention: modulesOptions?.localsConvention ?? undefined, getJSON( cssFileName: string, _modules: Record, diff --git a/packages/vite/src/types/shims.d.ts b/packages/vite/src/types/shims.d.ts index 110b34024cd161..db5ce9bc1dfb37 100644 --- a/packages/vite/src/types/shims.d.ts +++ b/packages/vite/src/types/shims.d.ts @@ -8,10 +8,6 @@ declare module 'cors' { export = cors } -declare module 'selfsigned' { - export function generate(attrs: any, options: any, done?: any): any -} - declare module 'http-proxy' { const proxy: any export = proxy @@ -27,18 +23,6 @@ declare module 'launch-editor-middleware' { export = plugin } -declare module 'postcss-load-config' { - import type { Plugin, ProcessOptions } from 'postcss' - function load( - inline: any, - root: string - ): Promise<{ - options: ProcessOptions - plugins: Plugin[] - }> - export = load -} - declare module 'postcss-import' { import type { Plugin } from 'postcss' const plugin: (options: { @@ -52,45 +36,6 @@ declare module 'postcss-import' { export = plugin } -declare module 'postcss-modules' { - import type { Plugin } from 'postcss' - const plugin: (options: any) => Plugin - export = plugin -} - -declare module '@rollup/plugin-dynamic-import-vars' { - import type { Plugin } from 'rollup' - import type { BaseNode } from 'estree' - - interface Options { - include?: string | RegExp | (string | RegExp)[] - exclude?: string | RegExp | (string | RegExp)[] - warnOnError?: boolean - } - - const p: (o?: Options) => Plugin - export default p - export function dynamicImportToGlob( - ast: BaseNode, - source: string - ): null | string -} - -declare module 'rollup-plugin-web-worker-loader' { - import type { Plugin } from 'rollup' - - interface Options { - targetPlatform?: string - pattern?: RegExp - extensions?: string[] - sourcemap?: boolean - inline?: boolean - } - - const p: (o?: Options) => Plugin - export default p -} - // LESS' types somewhat references this which doesn't make sense in Node, // so we have to shim it declare interface HTMLLinkElement {}