Skip to content

A minimalistic library which will prevent code from compiling if "var" is used as a type identifier.

License

Notifications You must be signed in to change notification settings

Unknown6656-Megacorp/DontUseVar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Don't use var!

A minimalistic library which will prevent code from compiling if var is used as a type identifier instead of the type name.
image
image

To use this library in your project, use one of the following methods:

  • Package Manager:

    PM> Install-Package Unknown6656.DontUseVar
  • .NET CLI:

    > dotnet add package Unknown6656.DontUseVar
  • Package reference (e.g. in a .csproj/.vbproj/.fsproj project file):

    <PackageReference Include="Unknown6656.DontUseVar" Version="*" />
  • Paket CLI:

    > paket add Unknown6656.DontUseVar
  • F# Interactive:

    #r "nuget: Unknown6656.DontUseVar, *"

Caution

As NuGet dependencies are cascading transitively, it might be wise to reference Unknown6656.DontUseVar only during Debug mode:

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
    <PackageReference Include="Unknown6656.DontUseVar" Version="*" />
</ItemGroup>

Otherwise, other code bases using your library will also be forced to not use var, which might lead to breaking changes (especially when anonymous classes are involved).

About

A minimalistic library which will prevent code from compiling if "var" is used as a type identifier.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published