0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

chore: remove unused imports (#12696)

This commit is contained in:
Florian Lefebvre 2024-12-11 16:01:06 +01:00 committed by GitHub
parent dff04a4b15
commit 110fc01a5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 8 additions and 10 deletions

View file

@ -1,6 +1,6 @@
import fs from 'node:fs/promises'; import fs from 'node:fs/promises';
import path from 'node:path'; import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url'; import { pathToFileURL } from 'node:url';
import mri from 'mri'; import mri from 'mri';
import { makeProject } from './bench/_util.js'; import { makeProject } from './bench/_util.js';

View file

@ -1,4 +1,4 @@
import type { AstroAdapter, AstroIntegration } from 'astro'; import type { AstroIntegration } from 'astro';
export default function createIntegration(): AstroIntegration { export default function createIntegration(): AstroIntegration {
return { return {

View file

@ -34,6 +34,7 @@
"correctness": { "correctness": {
"noUnusedVariables": "info", "noUnusedVariables": "info",
"noUnusedFunctionParameters": "info", "noUnusedFunctionParameters": "info",
"noUnusedImports": "warn",
}, },
}, },
}, },
@ -87,11 +88,12 @@
}, },
}, },
{ {
"include": ["*.astro", "client.d.ts"], "include": ["*.astro", "client.d.ts", "jsx-runtime.d.ts"],
"linter": { "linter": {
"rules": { "rules": {
"correctness": { "correctness": {
"noUnusedVariables": "off", "noUnusedVariables": "off",
"noUnusedImports": "off",
}, },
}, },
}, },

View file

@ -1,5 +1,4 @@
import { toStyleString } from '../../runtime/server/render/util.js'; import { toStyleString } from '../../runtime/server/render/util.js';
import type { AstroConfig } from '../../types/public/config.js';
import type { GetImageResult, ImageLayout, LocalImageProps, RemoteImageProps } from '../types.js'; import type { GetImageResult, ImageLayout, LocalImageProps, RemoteImageProps } from '../types.js';
export function addCSSVarsToStyle( export function addCSSVarsToStyle(

View file

@ -5,7 +5,6 @@ import {
REROUTABLE_STATUS_CODES, REROUTABLE_STATUS_CODES,
REROUTE_DIRECTIVE_HEADER, REROUTE_DIRECTIVE_HEADER,
clientAddressSymbol, clientAddressSymbol,
clientLocalsSymbol,
responseSentSymbol, responseSentSymbol,
} from '../constants.js'; } from '../constants.js';
import { getSetCookiesFromResponse } from '../cookies/index.js'; import { getSetCookiesFromResponse } from '../cookies/index.js';

View file

@ -5,7 +5,6 @@ import type { Plugin as VitePlugin } from 'vite';
import { getAssetsPrefix } from '../../../assets/utils/getAssetsPrefix.js'; import { getAssetsPrefix } from '../../../assets/utils/getAssetsPrefix.js';
import { normalizeTheLocale } from '../../../i18n/index.js'; import { normalizeTheLocale } from '../../../i18n/index.js';
import { toFallbackType, toRoutingStrategy } from '../../../i18n/utils.js'; import { toFallbackType, toRoutingStrategy } from '../../../i18n/utils.js';
import { unwrapSupportKind } from '../../../integrations/features-validation.js';
import { runHookBuildSsr } from '../../../integrations/hooks.js'; import { runHookBuildSsr } from '../../../integrations/hooks.js';
import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js'; import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js';
import type { import type {

View file

@ -1,5 +1,4 @@
import type { Plugin as VitePlugin } from 'vite'; import type { Plugin as VitePlugin } from 'vite';
import type { AstroSettings } from '../../../types/astro.js';
import type { AstroAdapter } from '../../../types/public/integrations.js'; import type { AstroAdapter } from '../../../types/public/integrations.js';
import { routeIsRedirect } from '../../redirects/index.js'; import { routeIsRedirect } from '../../redirects/index.js';
import { VIRTUAL_ISLAND_MAP_ID } from '../../server-islands/vite-plugin-server-islands.js'; import { VIRTUAL_ISLAND_MAP_ID } from '../../server-islands/vite-plugin-server-islands.js';

View file

@ -11,7 +11,7 @@ import { req } from '../core/messages.js';
import { loadMiddleware } from '../core/middleware/loadMiddleware.js'; import { loadMiddleware } from '../core/middleware/loadMiddleware.js';
import { routeIsRedirect } from '../core/redirects/index.js'; import { routeIsRedirect } from '../core/redirects/index.js';
import { RenderContext } from '../core/render-context.js'; import { RenderContext } from '../core/render-context.js';
import { type SSROptions, getProps } from '../core/render/index.js'; import { getProps } from '../core/render/index.js';
import { createRequest } from '../core/request.js'; import { createRequest } from '../core/request.js';
import { redirectTemplate } from '../core/routing/3xx.js'; import { redirectTemplate } from '../core/routing/3xx.js';
import { matchAllRoutes } from '../core/routing/index.js'; import { matchAllRoutes } from '../core/routing/index.js';

View file

@ -1,6 +1,7 @@
// @ts-check // @ts-check
import { schema } from 'virtual:astro:env/internal'; import { schema } from 'virtual:astro:env/internal';
import { import {
// biome-ignore lint/correctness/noUnusedImports: `_getEnv` is used by the generated code
getEnv as _getEnv, getEnv as _getEnv,
createInvalidVariablesError, createInvalidVariablesError,
getEnvFieldType, getEnvFieldType,

View file

@ -1,6 +1,5 @@
import * as assert from 'node:assert/strict'; import * as assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test'; import { after, before, describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import * as cheerio from 'cheerio'; import * as cheerio from 'cheerio';
import { createContainer } from '../../../dist/core/dev/container.js'; import { createContainer } from '../../../dist/core/dev/container.js';
import { createViteLoader } from '../../../dist/core/module-loader/vite.js'; import { createViteLoader } from '../../../dist/core/module-loader/vite.js';

View file

@ -26,7 +26,6 @@ import {
type LateSeedFiles, type LateSeedFiles,
type LateTables, type LateTables,
type SeedHandler, type SeedHandler,
resolved,
vitePluginDb, vitePluginDb,
} from './vite-plugin-db.js'; } from './vite-plugin-db.js';

View file

@ -1,6 +1,7 @@
import type { Tokenizer } from '@markdoc/markdoc'; import type { Tokenizer } from '@markdoc/markdoc';
import { Parser } from 'htmlparser2'; import { Parser } from 'htmlparser2';
// @ts-expect-error This type isn't exported // @ts-expect-error This type isn't exported
// biome-ignore lint/correctness/noUnusedImports: not correctly detected because type isn't exported
import type * as Token from 'markdown-it/lib/token'; import type * as Token from 'markdown-it/lib/token';
export function htmlTokenTransform(tokenizer: Tokenizer, tokens: Token[]): Token[] { export function htmlTokenTransform(tokenizer: Tokenizer, tokens: Token[]): Token[] {