0

I am struggling with dotnet jb cleanupcode changing

    UserEntity[] users = [
        new() {
            Name = "Example User 1",
        },
        new() {
            Name = "Example User 2",
        },
    ];

to

    UserEntity[] users = [
        new UserEntity {
            Name = "Example User 1",
        },
        new UserEntity {
            Name = "Example User 2",
        },
    ];

Both Rider and my CI in which I execute the same commands suggest me using the first variant. This means somewhere in my environment the rule that causes this, is configured inconsistently between CI/IDE and local environment.

I can't seem to find the correct rule for the redundant type specification though. Which rules could cause this (.editorconfig / roslyn etc.)?

1 Answer 1

0

You can set the new expression style in Rider as the following settings. The corresponding ReSharper EditorConfig flag is resharper_arrange_object_creation_when_type_evident_highlighting enter image description here

Have a check on this rule.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.