Skip to content

Commit 64d891e

Browse files
committed
chore: tsconfig - strict module syntax
1 parent d601036 commit 64d891e

File tree

19 files changed

+68
-58
lines changed

19 files changed

+68
-58
lines changed

configs/tsconfig-custom/tsconfig.base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
4444
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
4545
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
46-
"rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
46+
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
4747
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
4848
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
4949
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
@@ -84,7 +84,7 @@
8484

8585
/* Interop Constraints */
8686
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
87-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
87+
"verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
8888
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
8989
// "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
9090
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */

packages/babel/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { PluginObj, transformSync } from "@babel/core";
2-
import { transformCallExpression } from "@/transforms/callExpression.js";
3-
import postprocess from "@/transforms/postprocess.js";
4-
import preprocess from "@/transforms/preprocess.js";
5-
import { PluginOptions, PluginState } from "@/types.js";
6-
import { styledComponentPlugin } from "@/styled.js";
1+
import { type PluginObj, transformSync } from "@babel/core";
2+
import { transformCallExpression } from "./transforms/callExpression.js";
3+
import postprocess from "./transforms/postprocess.js";
4+
import preprocess from "./transforms/preprocess.js";
5+
import type { PluginOptions, PluginState } from "./types.js";
6+
import { styledComponentPlugin } from "./styled.js";
77

88
export function minchoBabelPlugin(): PluginObj<PluginState> {
99
return {
@@ -18,8 +18,8 @@ export function minchoBabelPlugin(): PluginObj<PluginState> {
1818
};
1919
}
2020

21-
export { styledComponentPlugin as minchoStyledComponentPlugin } from "@/styled.js";
22-
export type { PluginOptions } from "@/types.js";
21+
export { styledComponentPlugin as minchoStyledComponentPlugin } from "./styled.js";
22+
export type { PluginOptions } from "./types.js";
2323

2424
// == Tests ====================================================================
2525
// Ignore errors when compiling to CommonJS.

packages/babel/src/transforms/callExpression.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { ProgramScope } from "@/types.js";
1+
import { NodePath, types as t } from "@babel/core";
2+
import type { ProgramScope } from "../types.js";
23
import {
34
extractionAPIs,
45
getNearestIdentifier,
56
registerImportMethod
6-
} from "@/utils.js";
7-
import { NodePath, types as t } from "@babel/core";
7+
} from "../utils.js";
88

99
/**
1010
* Transforms a call expression to import the CSS

packages/babel/src/transforms/postprocess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NodePath, types as t, transformFromAstSync } from "@babel/core";
2-
import type { PluginState, ProgramScope } from "@/types.js";
2+
import type { PluginState, ProgramScope } from "../types.js";
33

44
export default function postprocess(
55
path: NodePath<t.Node>,

packages/babel/src/transforms/preprocess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { ProgramScope } from "@/types.js";
21
import { NodePath, types as t } from "@babel/core";
32
import hash from "@emotion/hash";
3+
import type { ProgramScope } from "../types.js";
44

55
/**
66
* Process the program before Babel applies transformations

packages/esbuild/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { dirname, join } from "node:path";
22
import { processVanillaFile } from "@vanilla-extract/integration";
33
import { vanillaExtractPlugin } from "@vanilla-extract/esbuild-plugin";
4-
import { Plugin as EsbuildPlugin } from "esbuild";
4+
import { type Plugin as EsbuildPlugin } from "esbuild";
55
import { babelTransform, compile } from "@mincho-js/integration";
66

77
interface MinchoEsbuildPluginOptions {

packages/integration/src/babel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { TransformOptions, transformFileAsync } from "@babel/core";
1+
import { type TransformOptions, transformFileAsync } from "@babel/core";
22
import {
3-
PluginOptions,
3+
type PluginOptions,
44
minchoBabelPlugin,
55
minchoStyledComponentPlugin
66
} from "@mincho-js/babel";

packages/integration/src/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { basename, dirname, join } from "node:path";
22
import * as fs from "node:fs";
33
import { addFileScope, getPackageInfo } from "@vanilla-extract/integration";
4-
import defaultEsbuild, { PluginBuild } from "esbuild";
4+
import defaultEsbuild, { type PluginBuild } from "esbuild";
55
import { transformSync } from "@babel/core";
66
import { minchoStyledComponentPlugin } from "@mincho-js/babel";
77

packages/integration/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { babelTransform, type BabelOptions } from "@/babel.js";
2-
export { compile } from "@/compile.js";
1+
export { babelTransform, type BabelOptions } from "./babel.js";
2+
export { compile } from "./compile.js";

packages/react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import type {
2020
RefAttributes
2121
} from "react";
2222

23-
import { tags, SupportedElements } from "./tags.js";
23+
import { tags, type SupportedElements } from "./tags.js";
2424

2525
export { $$styled } from "./runtime.js";
2626

0 commit comments

Comments
 (0)