Skip to content

Commit e90bebe

Browse files
fix: remove unused functions to address golangci-lint warnings
Remove unused functions in dot_notation rule: - matchesIndexSignaturePattern - buildUseDotMessage - buildUseBracketsMessage These functions were detected as unused by golangci-lint and were causing CI failures.
1 parent d33a608 commit e90bebe

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

internal/rules/dot_notation/dot_notation.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -298,23 +298,6 @@ func hasIndexSignature(ctx rule.RuleContext, objectType *checker.Type) bool {
298298
return numberIndexType != nil
299299
}
300300

301-
// matchesIndexSignaturePattern checks if a property name matches index signature patterns
302-
// For now, we'll use a simple heuristic: if the property is not explicitly declared
303-
// but the type has index signatures, we allow bracket notation
304-
func matchesIndexSignaturePattern(ctx rule.RuleContext, objectType *checker.Type, propertyName string) bool {
305-
if objectType == nil {
306-
return false
307-
}
308-
309-
// Simple heuristic: if we have index signatures and the property is not explicitly declared,
310-
// allow bracket notation. This handles cases like template literal types.
311-
if hasIndexSignature(ctx, objectType) {
312-
propSymbol := ctx.TypeChecker.GetPropertyOfType(objectType, propertyName)
313-
return propSymbol == nil
314-
}
315-
316-
return false
317-
}
318301

319302
// matchesTemplateLiteralPattern checks if a property name matches template literal patterns
320303
// This is a heuristic to handle cases like `key_${string}` where `key_baz` should be allowed
@@ -474,17 +457,3 @@ func getKeywordText(node *ast.Node) string {
474457
}
475458
}
476459

477-
// Message builders
478-
func buildUseDotMessage(key string) rule.RuleMessage {
479-
return rule.RuleMessage{
480-
Id: "useDot",
481-
Description: fmt.Sprintf("[%s] is better written in dot notation.", key),
482-
}
483-
}
484-
485-
func buildUseBracketsMessage(key string) rule.RuleMessage {
486-
return rule.RuleMessage{
487-
Id: "useBrackets",
488-
Description: fmt.Sprintf(".%s is a syntax error.", key),
489-
}
490-
}

0 commit comments

Comments
 (0)