File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
/** @import { TSESTree } from '@typescript-eslint/types' */
2
2
/** @import { Visitors } from '../types.js' */
3
- /** @import { TSOptions } from './types.js' */
3
+ /** @import { TSOptions, Comment } from './types.js' */
4
4
import { Context } from '../context.js' ;
5
5
6
6
/** @type {Record<TSESTree.Expression['type'] | 'Super' | 'RestElement', number> } */
@@ -72,7 +72,7 @@ const OPERATOR_PRECEDENCE = {
72
72
} ;
73
73
74
74
/**
75
- * @param {TSESTree. Comment } comment
75
+ * @param {Comment } comment
76
76
* @param {Context } context
77
77
*/
78
78
function write_comment ( comment , context ) {
Original file line number Diff line number Diff line change @@ -2,5 +2,23 @@ import type { TSESTree } from '@typescript-eslint/types';
2
2
3
3
export type TSOptions = {
4
4
quotes ?: 'double' | 'single' ;
5
- comments ?: TSESTree . Comment [ ] ;
5
+ comments ?: Comment [ ] ;
6
6
} ;
7
+
8
+ interface Position {
9
+ line : number ;
10
+ column : number ;
11
+ }
12
+
13
+ // this exists in TSESTree but because of the inanity around enums
14
+ // it's easier to do this ourselves
15
+ export interface Comment {
16
+ type : 'Line' | 'Block' ;
17
+ value : string ;
18
+ start ?: number ;
19
+ end ?: number ;
20
+ loc : {
21
+ start : Position ;
22
+ end : Position ;
23
+ } ;
24
+ }
You can’t perform that action at this time.
0 commit comments