-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FavourNestedFunctions: hook cfg & add docs
Updated Configuration.fs and fsharplint.json to include FavourNestedFunctions rule. Added docs.
- Loading branch information
1 parent
62375ea
commit 8d130ab
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: FL0082 | ||
category: how-to | ||
hide_menu: true | ||
--- | ||
|
||
# FavourNestedFunctions (FL0082) | ||
|
||
*Introduced in `0.23.0`* | ||
|
||
## Cause | ||
|
||
Prefer using local (nested) functions over private module-level functions. | ||
|
||
## Rationale | ||
|
||
With a nested function, one can clearly see from reading the code that there is only one consumer of the function. | ||
The code being this way becomes more streamlined. | ||
Code is also more concise because nested functions don't need accessibility modifiers. | ||
|
||
## How To Fix | ||
|
||
Move private function inside function that uses it. | ||
|
||
## Rule Settings | ||
|
||
{ | ||
"FavourNestedFunctions": { | ||
"enabled": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters