Skip to content

Commit 17c22f5

Browse files
committed
include types
1 parent ef4051a commit 17c22f5

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
"default": "./src/index.js"
1818
},
1919
"./languages/ts": {
20+
"types": "./types/index.d.ts",
2021
"default": "./src/languages/ts.js"
2122
},
2223
"./languages/tsx": {
24+
"types": "./types/index.d.ts",
2325
"default": "./src/languages/tsx.js"
2426
}
2527
},
@@ -40,7 +42,7 @@
4042
"changeset:version": "changeset version",
4143
"changeset:publish": "changeset publish",
4244
"check": "tsc",
43-
"prepublishOnly": "pnpm test && dts-buddy -m esrap:./src/public.d.ts",
45+
"prepublishOnly": "pnpm test && dts-buddy -m esrap:./src/public.d.ts -m esrap/languages/ts:./src/languages/ts.js -m esrap/languages/tsx:./src/languages/tsx.js",
4446
"sandbox": "node test/sandbox/index.js",
4547
"test": "vitest --run",
4648
"test:ui": "vitest --ui"

src/languages/ts.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @import { TSESTree } from '@typescript-eslint/types' */
22
/** @import { Visitors } from '../types.js' */
3+
/** @import { TSOptions } from './types.js' */
34
import { Context } from '../context.js';
45

56
/** @type {Record<TSESTree.Expression['type'] | 'Super' | 'RestElement', number>} */
@@ -91,10 +92,7 @@ function write_comment(comment, context) {
9192
}
9293

9394
/**
94-
* @param {{
95-
* quotes?: 'double' | 'single';
96-
* comments?: TSESTree.Comment[];
97-
* }} [options]
95+
* @param {TSOptions} [options]
9896
* @returns {Visitors<TSESTree.Node>}
9997
*/
10098
export default (options = {}) => {

src/languages/tsx.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/** @import { Visitors } from '../types' */
2+
/** @import { TSOptions } from './types.js' */
23
import { TSESTree } from '@typescript-eslint/types';
34
import ts from './ts.js';
45

56
/**
6-
* @param {Parameters<typeof ts>[0]} [options]
7+
* @param {TSOptions} [options]
78
* @returns {Visitors<TSESTree.Node>}
89
*/
910
export default (options) => ({

src/languages/types.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { TSESTree } from '@typescript-eslint/types';
2+
3+
export type TSOptions = {
4+
quotes?: 'double' | 'single';
5+
comments?: TSESTree.Comment[];
6+
};

0 commit comments

Comments
 (0)