This repo illustrates how to distribute custom rules for StyleCopAnalyzers in the form of a Nuget package, based on the documentation.
This was created to accompany my introductory blog post about setting up linting for your .NET Core project.
If we want to create the package with the
dotnet CLI, it's important that it doesn't pick up the
nuspec file automatically, we have to explicitly specify it as an MSBuild argument.
dotnet pack -c Release /p:NuspecFile=MyCustomStyleCopAnalyzerPackage.nuspec