mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix: Make std work with isolatedModules (#7016)
This commit is contained in:
parent
58f86e063a
commit
81ce4499e7
5 changed files with 9 additions and 6 deletions
|
@ -30,9 +30,9 @@ information. For this purpose TypeScript provides the
|
||||||
To export a type in a different file use
|
To export a type in a different file use
|
||||||
`export type { AnInterface } from "./mod.ts";`. To import a type use
|
`export type { AnInterface } from "./mod.ts";`. To import a type use
|
||||||
`import type { AnInterface } from "./mod.ts";`. You can check that you are using
|
`import type { AnInterface } from "./mod.ts";`. You can check that you are using
|
||||||
`import type` and `export type` where necessary by setting the
|
`import type` and `export type` where necessary by setting the `isolatedModules`
|
||||||
`importsNotUsedAsValues` TypeScript compiler option to `"error"`. You can see an
|
TypeScript compiler option to `true`. You can see an example `tsconfig.json`
|
||||||
example `tsconfig.json` with this option
|
with this option
|
||||||
[in the standard library](https://github.com/denoland/deno/blob/master/std/tsconfig_test.json).
|
[in the standard library](https://github.com/denoland/deno/blob/master/std/tsconfig_test.json).
|
||||||
|
|
||||||
Because there is no type information when using `--no-check`, `const enum` is
|
Because there is no type information when using `--no-check`, `const enum` is
|
||||||
|
|
|
@ -3,8 +3,8 @@ import {
|
||||||
LogLevels,
|
LogLevels,
|
||||||
getLevelByName,
|
getLevelByName,
|
||||||
getLevelName,
|
getLevelName,
|
||||||
LevelName,
|
|
||||||
} from "./levels.ts";
|
} from "./levels.ts";
|
||||||
|
import type { LevelName } from "./levels.ts";
|
||||||
import type { BaseHandler } from "./handlers.ts";
|
import type { BaseHandler } from "./handlers.ts";
|
||||||
|
|
||||||
export interface LogRecordOptions {
|
export interface LogRecordOptions {
|
||||||
|
|
|
@ -10,7 +10,8 @@ import {
|
||||||
import { assert } from "../_util/assert.ts";
|
import { assert } from "../_util/assert.ts";
|
||||||
import type { LevelName } from "./levels.ts";
|
import type { LevelName } from "./levels.ts";
|
||||||
|
|
||||||
export { LogLevels, LevelName } from "./levels.ts";
|
export { LogLevels } from "./levels.ts";
|
||||||
|
export type { LevelName } from "./levels.ts";
|
||||||
export { Logger } from "./logger.ts";
|
export { Logger } from "./logger.ts";
|
||||||
|
|
||||||
export class LoggerConfig {
|
export class LoggerConfig {
|
||||||
|
|
|
@ -7,3 +7,5 @@ Object.defineProperty(globalThis, Symbol.toStringTag, {
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
(globalThis as any)["global"] = globalThis;
|
(globalThis as any)["global"] = globalThis;
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"importsNotUsedAsValues": "error"
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue