@@ -38,7 +38,6 @@ function partsToAlias(parts: string[]): RelationAlias | null {
3838/** If `pos` points at an `(`, skip past the matching `)` and return the
3939 * position after it. Otherwise return `pos` unchanged. */
4040function skipOptionalParenGroup ( tokens : Token [ ] , pos : number ) : number {
41- // eslint-disable-next-line security/detect-object-injection
4241 if ( tokens [ pos ] ?. type !== LPAREN ) return pos ;
4342 return parenGroupEndPosition ( tokens , pos ) . pos ;
4443}
@@ -52,7 +51,6 @@ function skipOptionalParenGroup(tokens: Token[], pos: number): number {
5251function cursorScopeTokens ( tokens : Token [ ] , cursor : number ) : Token [ ] | null {
5352 let pos = 0 ;
5453 while ( pos < tokens . length ) {
55- // eslint-disable-next-line security/detect-object-injection
5654 if ( tokens [ pos ] . type !== LPAREN ) {
5755 pos ++ ;
5856 continue ;
@@ -67,7 +65,7 @@ function cursorScopeTokens(tokens: Token[], cursor: number): Token[] | null {
6765 }
6866
6967 const { pos : end , closed } = parenGroupEndPosition ( tokens , pos ) ;
70- // eslint-disable-next-line security/detect-object-injection
68+
7169 const openChar = tokens [ pos ] . start ;
7270
7371 // Cursor is inside this body if it's past the opening `(` and either
@@ -100,15 +98,15 @@ export function extractPrefixAtCursor(
10098) : { prefixParts : string [ ] ; wordAtCursor : string } {
10199 // Step 1: find the last token that starts before the cursor.
102100 let pos = tokens . length - 1 ;
103- // eslint-disable-next-line security/detect-object-injection
101+
104102 while ( pos >= 0 && tokens [ pos ] . start >= cursorInStatement ) pos -- ;
105103 if ( pos < 0 ) return { prefixParts : [ ] , wordAtCursor : '' } ;
106104
107105 // Step 2: classify that token relative to the cursor. Three cases:
108106 // A) cursor is inside/at the end of an identifier → that's the partial word
109107 // B) cursor is immediately after a dot → no word yet, prefix continues
110108 // C) cursor is attached to something else (keyword, operator) → no prefix
111- // eslint-disable-next-line security/detect-object-injection
109+
112110 const last = tokens [ pos ] ;
113111 const lastEndExclusive = last . stop + 1 ;
114112 const cursorTouchesLast = lastEndExclusive >= cursorInStatement ;
@@ -129,7 +127,7 @@ export function extractPrefixAtCursor(
129127
130128 // Step 3: walk backwards through (DOT IDENTIFIER)* pairs.
131129 const prefixParts : string [ ] = [ ] ;
132- // eslint-disable-next-line security/detect-object-injection
130+
133131 while ( pos >= 1 && tokens [ pos ] . type === DOT && IDENTIFIER_TOKENS . has ( tokens [ pos - 1 ] . type ) ) {
134132 prefixParts . unshift ( unquoteIdentifier ( tokens [ pos - 1 ] . text ?? '' ) ) ;
135133 pos -= 2 ;
@@ -173,7 +171,6 @@ export function extractAliasMap(
173171 const aliasMap = new Map < string , RelationAlias > ( ) ;
174172
175173 for ( let pos = 0 ; pos < tokens . length ; pos ++ ) {
176- // eslint-disable-next-line security/detect-object-injection
177174 const token = tokens [ pos ] ;
178175
179176 // FROM / JOIN <qualifiedName> [[AS] alias]
@@ -186,11 +183,10 @@ export function extractAliasMap(
186183 // Lowercase for case-insensitive lookup.
187184 aliasMap . set ( alias . table . toLowerCase ( ) , alias ) ;
188185 // Optional [AS] <identifier> follows the name.
189- // eslint-disable-next-line security/detect-object-injection
186+
190187 if ( tokens [ next ] ?. type === SqlBaseLexer . AS ) next ++ ;
191- // eslint-disable-next-line security/detect-object-injection
188+
192189 if ( tokens [ next ] && IDENTIFIER_TOKENS . has ( tokens [ next ] . type ) ) {
193- // eslint-disable-next-line security/detect-object-injection
194190 const aliasName = unquoteIdentifier ( tokens [ next ] . text ?? '' ) ;
195191 aliasMap . set ( aliasName . toLowerCase ( ) , alias ) ;
196192 next ++ ;
@@ -204,20 +200,19 @@ export function extractAliasMap(
204200 // the JSDoc for why the body is skipped).
205201 if ( token . type === SqlBaseLexer . WITH ) {
206202 let next = pos + 1 ;
207- // eslint-disable-next-line security/detect-object-injection
203+
208204 while ( next < tokens . length && IDENTIFIER_TOKENS . has ( tokens [ next ] . type ) ) {
209- // eslint-disable-next-line security/detect-object-injection
210205 const cteName = unquoteIdentifier ( tokens [ next ] . text ?? '' ) ;
211206 aliasMap . set ( cteName . toLowerCase ( ) , { table : cteName } ) ;
212207 next ++ ;
213208
214209 next = skipOptionalParenGroup ( tokens , next ) ; // optional column list
215- // eslint-disable-next-line security/detect-object-injection
210+
216211 if ( tokens [ next ] ?. type === SqlBaseLexer . AS ) next ++ ;
217212 next = skipOptionalParenGroup ( tokens , next ) ; // CTE body
218213
219214 // Comma means another CTE follows; anything else ends the WITH list.
220- // eslint-disable-next-line security/detect-object-injection
215+
221216 if ( tokens [ next ] ?. type !== COMMA ) break ;
222217 next ++ ;
223218 }
0 commit comments