Skip to content

Commit 45cdb79

Browse files
committed
tidy up
1 parent c833cfd commit 45cdb79

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

src/languages/ts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @import { TSESTree } from '@typescript-eslint/types' */
2-
/** @import { Visitors, NodeWithComments, Context } from '../types.js' */
2+
/** @import { Visitors, Context } from '../types.js' */
33

44
/** @type {Record<TSESTree.Expression['type'] | 'Super' | 'RestElement', number>} */
55
export const EXPRESSIONS_PRECEDENCE = {

src/types.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ type TSExpressionWithTypeArguments = {
3535
expression: any;
3636
};
3737

38-
// `@typescript-eslint/types` differs from the official `estree` spec by handling
39-
// comments differently. This is a node which we can use to ensure type saftey.
40-
export type NodeWithComments = {
41-
leadingComments?: TSESTree.Comment[] | undefined;
42-
trailingComments?: TSESTree.Comment[] | undefined;
43-
} & TSESTree.Node;
44-
4538
export interface Location {
4639
type: 'Location';
4740
line: number;

test/common.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
import * as acorn from 'acorn';
44
import { tsPlugin } from '@sveltejs/acorn-typescript';
5-
import { walk } from 'zimmerframe';
65

76
/** @import { TSESTree } from '@typescript-eslint/types' */
8-
/** @import { NodeWithComments } from '../src/types' */
97

108
// @ts-expect-error
119
export const acornTs = acorn.Parser.extend(tsPlugin({ allowSatisfies: true }));

test/esrap.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22
/** @import { TSESTree } from '@typescript-eslint/types' */
3-
/** @import { Visitors, PrintOptions } from '../src/types' */
3+
/** @import { PrintOptions } from '../src/types' */
44
import fs from 'node:fs';
55
import { expect, test } from 'vitest';
66
import { walk } from 'zimmerframe';
@@ -18,10 +18,6 @@ function clean(ast) {
1818
delete node.start;
1919
// @ts-expect-error
2020
delete node.end;
21-
// @ts-expect-error
22-
delete node.leadingComments;
23-
// @ts-expect-error
24-
delete node.trailingComments;
2521
context.next();
2622
},
2723
Program(node, context) {

0 commit comments

Comments
 (0)