File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @loat-dev/lint-plugins" ,
3- "version" : " 0.3.10 " ,
3+ "version" : " 0.3.11 " ,
44 "license" : " ./LICENSE" ,
55 "exports" : {
66 "./colon_spacing" : " ./src/plugins/colon_spacing.ts" ,
Original file line number Diff line number Diff line change @@ -124,15 +124,18 @@ const colonSpacing : Deno.lint.Plugin = {
124124 }
125125 } ,
126126 Identifier ( node ) : void {
127- if ( node . typeAnnotation && node . parent . type !== 'TSIndexSignature' ) {
128- // Text _ from "<name>___?__:<type>"
129- const section : Deno . lint . Range = [ node . range [ 1 ] , node . typeAnnotation . range [ 0 ] ]
127+ if ( node . typeAnnotation ) {
128+ // Text _ from "_ <name>___?__:<type>"
129+ const section : Deno . lint . Range = [ node . range [ 0 ] , node . typeAnnotation . range [ 0 ] ]
130130
131- // Text _ from "<name>___?__:<type>"
131+ // Text _ from "_ <name>___?__:<type>"
132132 const text = context . sourceCode . getText ( node . parent ) . substring (
133- node . range [ 1 ] - node . parent . range [ 0 ] ,
134- node . typeAnnotation . range [ 0 ] - node . parent . range [ 0 ]
133+ node . range [ 0 ] - node . parent . range [ 0 ] ,
134+ node . typeAnnotation . range [ 0 ] - node . parent . range [ 0 ] + 1
135135 )
136+
137+ // Section | from "<name>| |:<type>"
138+ section [ 0 ] += text . search ( / * : / ) ;
136139
137140 if ( node . optional ) {
138141 // Index of ? from "<name>?__:<type>"
You can’t perform that action at this time.
0 commit comments