Add an analyzer to prevent indexing a localized value instead of member name
Open
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
Assessment
This issue has not been assessed yet.