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 11/** @import { TSESTree } from '@typescript-eslint/types' */
22/** @import { Visitors } from '../types.js' */
3- /** @import { TSOptions } from './types.js' */
3+ /** @import { TSOptions, Comment } from './types.js' */
44import { Context } from '../context.js' ;
55
66/** @type {Record<TSESTree.Expression['type'] | 'Super' | 'RestElement', number> } */
@@ -72,7 +72,7 @@ const OPERATOR_PRECEDENCE = {
7272} ;
7373
7474/**
75- * @param {TSESTree. Comment } comment
75+ * @param {Comment } comment
7676 * @param {Context } context
7777 */
7878function 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';
22
33export type TSOptions = {
44 quotes ?: 'double' | 'single' ;
5- comments ?: TSESTree . Comment [ ] ;
5+ comments ?: Comment [ ] ;
66} ;
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