File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
crates/oxc_linter/src/rules/typescript Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -230,8 +230,8 @@ impl Rule for ConsistentIndexedObjectStyle {
230230 ) ,
231231 |fixer| {
232232 let key = fixer. source_range ( first. span ) ;
233- let params_span = Span :: new ( first. span . end + 2 , tref. span . end - 1 ) ;
234- let params = fixer. source_range ( params_span) ;
233+ let params_span = Span :: new ( first. span . end + 1 , tref. span . end - 1 ) ;
234+ let params = fixer. source_range ( params_span) . trim ( ) ;
235235 let content = format ! ( "{{ [key: {key}]: {params} }}" ) ;
236236 fixer. replace ( tref. span , content)
237237 } ,
@@ -263,6 +263,11 @@ fn test() {
263263 "type Foo<T> = { [key: string]: T };" ,
264264 Some ( serde_json:: json!( [ "index-signature" ] ) ) ,
265265 ) ,
266+ (
267+ "export function getCookies (headers: Headers): Record<string,Østring>" ,
268+ "export function getCookies (headers: Headers): { [key: string]: Østring }" ,
269+ Some ( serde_json:: json!( [ "index-signature" ] ) ) ,
270+ ) ,
266271 ] ;
267272
268273 let pass = vec ! [
You can’t perform that action at this time.
0 commit comments