Skip to main content

Linting

Rules we enforce:

  • Indentation is 4 spaces for tab;

  • No whitespace;

  • Public objects should be Pascal Case (e.g. PascalCase);

  • Local objects should be Camel Case (e.g. camelCase);

  • Class objects should be prefixed with an underscore;

  • Using directives should be outside the namespace;

  • No unused using directives;

  • One new line at the end of every file;

  • One class for a file;

  • Prefer the language keyword for local objects and member access;

  • Require accessibility modifiers for fields;

  • No unused parameters for non-public methods;

  • Use var where possible;

  • Brackets on a new line;

  • Comments on their own line;

  • No writing to console;

Tools:

We have chosen to use .editorconfig with dotnet format.

Dotnet Format:

Stylecop.analysers:

  • Project site;

  • ** Need to make a .ruleset file + stylecop.json to implement rules **;

  • Integrates with build;

Resharper: