Editorconfig not working with resharper inspection severity

Completed

I am unable to use `.editorconfig` files to configure the ReSharper inspection severity.

 

My `.editorconfig` looks like the following.

 

root = true

resharper_possible_null_reference_exception_highlighting=error
resharper_invert_if_highlighting=error

 

An example code file looks like

 

using System;

namespace ResharperQuickEditorConfigTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");

bool parsed = int.TryParse("HJ", out int test);

if (parsed)
{
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
}
}

private static object ReturnNull(object rf)
{
bool test = rf.Equals(3);
return null;
}
}
}

 

What I would expect would be two errors shown next to the if statement and next to the usage of `rf` in the private static method. However, they are shown as a hint and a warning instead. I have included a screenshot of my settings and what I can see on the code. The `.cs` file and the `.editorconfig`file are in the same directory. It is a .Net Core 3 Console Application.

I would really appreciate any help with finding out how to fix this.

1 comment
Comment actions Permalink

For anyone else who comes here, this was caused by a silly mistake.

root = true

[*]
resharper_possible_null_reference_exception_highlighting=error
resharper_invert_if_highlighting=error

By including ``[*]`` it fixed it.

 

0

Please sign in to leave a comment.