Skip to content

Commit

Permalink
chore: enable useImportType rule (#11848)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Aug 27, 2024
1 parent ed7bbd9 commit b601e47
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 31 deletions.
14 changes: 9 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"[json]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickFix.biome": true,
"source.fixAll.biome": true
}
}
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"rules": {
"recommended": false,
"style": {
"useNodejsImportProtocol": "error"
"useNodejsImportProtocol": "error",
"useImportType": "error"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/actions/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIContext } from '../@types/astro.js';
import type { Locals } from './runtime/middleware.js';
import { type ActionAPIContext } from './runtime/utils.js';
import type { ActionAPIContext } from './runtime/utils.js';
import { deserializeActionResult, getActionQueryString } from './runtime/virtual/shared.js';

export function hasActionPayload(locals: APIContext['locals']): locals is Locals {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/plugins/plugin-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { isContentCollectionsCacheEnabled } from '../../util.js';
import { addRollupInput } from '../add-rollup-input.js';
import { CHUNKS_PATH, CONTENT_PATH } from '../consts.js';
import { type BuildInternals } from '../internal.js';
import type { BuildInternals } from '../internal.js';
import type { AstroBuildPlugin } from '../plugin.js';
import { copyFiles } from '../static-build.js';
import type { StaticBuildOptions } from '../types.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/plugins/plugin-pages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Plugin as VitePlugin } from 'vite';
import { routeIsRedirect } from '../../redirects/index.js';
import { addRollupInput } from '../add-rollup-input.js';
import { type BuildInternals } from '../internal.js';
import type { BuildInternals } from '../internal.js';
import type { AstroBuildPlugin } from '../plugin.js';
import type { StaticBuildOptions } from '../types.js';
import { RENDERERS_MODULE_ID } from './plugin-renderers.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/client/dev-toolbar/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ResolvedDevToolbarApp as DevToolbarAppDefinition } from '../../../
import { type ToolbarAppEventTarget, serverHelpers } from './helpers.js';
import { settings } from './settings.js';
import { type Icon, getIconElement, isDefinedIcon } from './ui-library/icons.js';
import { type Placement } from './ui-library/window.js';
import type { Placement } from './ui-library/window.js';

export type DevToolbarApp = DevToolbarAppDefinition & {
builtIn: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro-server/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
SSRManifest,
} from '../@types/astro.js';
import { getInfoOutput } from '../cli/info/index.js';
import { type HeadElements } from '../core/base-pipeline.js';
import type { HeadElements } from '../core/base-pipeline.js';
import { ASTRO_VERSION } from '../core/constants.js';
import { enhanceViteSSRError } from '../core/errors/dev/index.js';
import { AggregateError, CSSError, MarkdownError } from '../core/errors/index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-scanner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bold } from 'kleur/colors';
import type { Plugin as VitePlugin } from 'vite';
import { normalizePath } from 'vite';
import type { AstroSettings, RouteOptions } from '../@types/astro.js';
import { type Logger } from '../core/logger/core.js';
import type { Logger } from '../core/logger/core.js';
import { isEndpoint, isPage, isServerLikeOutput } from '../core/util.js';
import { rootRelativePath } from '../core/viteUtils.js';
import { runHookRouteSetup } from '../integrations/hooks.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/core/cli/commands/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { bgRed, cyan } from 'kleur/colors';
import ora from 'ora';
import prompts from 'prompts';
import { safeFetch } from '../../../../runtime/utils.js';
import { type Result } from '../../../utils.js';
import type { Result } from '../../../utils.js';

export async function cmd() {
const sessionToken = await getSessionIdFromFile();
Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/core/cli/commands/push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import prompts from 'prompts';
import type { Arguments } from 'yargs-parser';
import { safeFetch } from '../../../../runtime/utils.js';
import { MIGRATION_VERSION } from '../../../consts.js';
import { type DBConfig, type DBSnapshot } from '../../../types.js';
import type { DBConfig, DBSnapshot } from '../../../types.js';
import { type Result, getRemoteDatabaseUrl } from '../../../utils.js';
import {
createCurrentSnapshot,
Expand Down
28 changes: 14 additions & 14 deletions packages/db/src/core/cli/migration-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ import {
schemaTypeToSqlType,
} from '../queries.js';
import { columnSchema } from '../schemas.js';
import {
type BooleanColumn,
type ColumnType,
type DBColumn,
type DBColumns,
type DBConfig,
type DBSnapshot,
type DateColumn,
type JsonColumn,
type NumberColumn,
type ResolvedDBTable,
type ResolvedDBTables,
type ResolvedIndexes,
type TextColumn,
import type {
BooleanColumn,
ColumnType,
DBColumn,
DBColumns,
DBConfig,
DBSnapshot,
DateColumn,
JsonColumn,
NumberColumn,
ResolvedDBTable,
ResolvedDBTables,
ResolvedIndexes,
TextColumn,
} from '../types.js';
import { type Result, getRemoteDatabaseUrl } from '../utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/core/queries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type SQL } from 'drizzle-orm';
import type { SQL } from 'drizzle-orm';
import { SQLiteAsyncDialect } from 'drizzle-orm/sqlite-core';
import { bold } from 'kleur/colors';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ColumnBuilderBaseConfig, type ColumnDataType, sql } from 'drizzle-orm';
import { type LibSQLDatabase } from 'drizzle-orm/libsql';
import type { LibSQLDatabase } from 'drizzle-orm/libsql';
import {
type IndexBuilder,
type SQLiteColumnBuilderBase,
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/markdoc/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Markdoc, {
} from '@markdoc/markdoc';
import type { AstroInstance } from 'astro';
import { createComponent, renderComponent } from 'astro/runtime/server/index.js';
import { type AstroMarkdocConfig } from './config.js';
import type { AstroMarkdocConfig } from './config.js';
import { setupHeadingConfig } from './heading-ids.js';
import { htmlTag } from './html/tagdefs/html.tag.js';
import type { MarkdocIntegrationOptions } from './options.js';
Expand Down

0 comments on commit b601e47

Please sign in to comment.