Skip to content

Commit

Permalink
Use var2 (SSWConsulting#8607)
Browse files Browse the repository at this point in the history
* Fix orphaned rule

* Referencing editor config file to keep things consistent.

* And a link to the recommended config.
  • Loading branch information
brydeno authored May 27, 2024
1 parent 7ce8b49 commit e37aadd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions categories/software-engineering/rules-to-better-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ index:
- do-you-use-primary-constructors
- do-you-use-collection-expressions
- interfaces-abstract-classes
- use-var

---

Expand Down
6 changes: 6 additions & 0 deletions rules/use-var/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ authors:
- title: Bryden Oliver
url: https://www.ssw.com.au/people/bryden-oliver
created: 2021-12-13T17:44:06.489Z
related:
- consistent-code-style
guid: edd8d397-3651-47c0-8737-fa38152558d1

---
Expand All @@ -29,3 +31,7 @@ var item = new List<string>();
::: good
Figure: Good example - Using "var" to save a few keystrokes and reduce repetition
:::

This can be kept consistent by creating an [editorconfig file](/consistent-code-style) which can then generate compile time warnings.

An [example editor config](https://github.com/SSWConsulting/SSW.CleanArchitecture/blob/main/.editorconfig), look for the **var preferences**.

0 comments on commit e37aadd

Please sign in to comment.