diff --git a/.changeset/wet-geckos-rush.md b/.changeset/wet-geckos-rush.md new file mode 100644 index 0000000..da923c1 --- /dev/null +++ b/.changeset/wet-geckos-rush.md @@ -0,0 +1,5 @@ +--- +'esrap': patch +--- + +fix: add `@typescript-eslint/types` as a dependency since some types are exported diff --git a/package.json b/package.json index 77484f0..6776dd1 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "devDependencies": { "@changesets/cli": "^2.27.11", "@sveltejs/acorn-typescript": "^1.0.5", - "@typescript-eslint/types": "^8.2.0", "@vitest/ui": "^2.1.1", "acorn": "^8.15.0", "dts-buddy": "^0.6.2", @@ -52,7 +51,8 @@ }, "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.4.15", + "@typescript-eslint/types": "^8.2.0" }, "packageManager": "pnpm@9.8.0", "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 125db92..2f981c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@jridgewell/sourcemap-codec': specifier: ^1.4.15 version: 1.5.0 + '@typescript-eslint/types': + specifier: ^8.2.0 + version: 8.46.1 devDependencies: '@changesets/cli': specifier: ^2.27.11 @@ -18,9 +21,6 @@ importers: '@sveltejs/acorn-typescript': specifier: ^1.0.5 version: 1.0.5(acorn@8.15.0) - '@typescript-eslint/types': - specifier: ^8.2.0 - version: 8.46.1 '@vitest/ui': specifier: ^2.1.1 version: 2.1.1(vitest@2.1.1) diff --git a/src/context.js b/src/context.js index d264282..f0e6b9f 100644 --- a/src/context.js +++ b/src/context.js @@ -1,4 +1,3 @@ -/** @import { TSESTree } from '@typescript-eslint/types' */ /** @import { BaseNode, Command, Visitors } from './types' */ export const margin = 0; diff --git a/src/languages/ts/public.d.ts b/src/languages/ts/public.d.ts index 4009459..b265ace 100644 --- a/src/languages/ts/public.d.ts +++ b/src/languages/ts/public.d.ts @@ -1,2 +1,2 @@ export * from './index'; -export { BaseComment, Comment } from '../types'; +export type { BaseComment, Comment } from '../types'; diff --git a/src/languages/tsx/public.d.ts b/src/languages/tsx/public.d.ts index 4009459..b265ace 100644 --- a/src/languages/tsx/public.d.ts +++ b/src/languages/tsx/public.d.ts @@ -1,2 +1,2 @@ export * from './index'; -export { BaseComment, Comment } from '../types'; +export type { BaseComment, Comment } from '../types'; diff --git a/src/languages/types.d.ts b/src/languages/types.d.ts index 20d2d76..20f06e1 100644 --- a/src/languages/types.d.ts +++ b/src/languages/types.d.ts @@ -1,5 +1,4 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { BaseNode } from '../types'; +import type { BaseNode } from '../types'; export type TSOptions = { quotes?: 'double' | 'single'; diff --git a/src/public.d.ts b/src/public.d.ts index 5fababa..7f36df5 100644 --- a/src/public.d.ts +++ b/src/public.d.ts @@ -1,2 +1,2 @@ -export { PrintOptions, Visitors } from './types'; +export type { PrintOptions, Visitors } from './types'; export * from './index'; diff --git a/src/types.d.ts b/src/types.d.ts index 5763af7..e862803 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,5 +1,4 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Context } from 'esrap'; +import type { Context } from 'esrap'; export type BaseNode = { type: string; @@ -23,19 +22,6 @@ export type Visitors = T['type'] extends '_' export { Context }; -export type TypeAnnotationNodes = - | TSESTree.TypeNode - | TSESTree.TypeElement - | TSESTree.TSTypeAnnotation - | TSESTree.TSPropertySignature - | TSESTree.TSTypeParameter - | TSESTree.TSTypeParameterDeclaration - | TSESTree.TSTypeParameterInstantiation - | TSESTree.TSEnumMember - | TSESTree.TSInterfaceHeritage - | TSESTree.TSClassImplements - | TSExpressionWithTypeArguments; - type TSExpressionWithTypeArguments = { type: 'TSExpressionWithTypeArguments'; expression: any;