Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditorConfig - simplify boolean evaluations?

Is there an EditorConfig setting for simplifying boolean evaluations in if statements? e.g.

// prefer:
if (thingy)

// over:
if (thingy == true)

and

// prefer:
if (!thingy)

// over:
if (thingy == false)
like image 770
Phil K Avatar asked Jan 21 '26 05:01

Phil K


1 Answers

You can configure the corresponding analyzer with this in your .editorconfig:

dotnet_diagnostic.IDE0100.severity = warning

See https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0100

like image 191
cezn Avatar answered Jan 23 '26 01:01

cezn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!