Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove non used type definitions #10738

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -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<string, string>,
Expand Down
55 changes: 0 additions & 55 deletions packages/vite/src/types/shims.d.ts
Expand Up @@ -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
Expand All @@ -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: {
Expand All @@ -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
}
Comment on lines -61 to -77
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this existed. But it seems this isn't necessary.


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 {}