microsoft / microsoft/aspire

Add an analyzer to prevent indexing a localized value instead of member name

Open
#6,352 8 comments 1 reaction 0 assignees View on GitHub
area-dashboard localization
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

See https://github.com/dotnet/aspire/pull/6209#discussion_r1803940775

We've had oodles of this kind of issue already, and it is incredibly easy to forget to add `nameof` to an `IStringLocalizer` call. We should create an analyzer to prevent it in the future.

Right:
`IStringLocalizer[nameof(T.Field)]`

Wrong:
`IStringLocalizer[T.Field]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.