View compiler warnings without actually building the codebase?

Is there any way to view compiler warnings without actually building the codebase? As in something along the lines of "dotnet build --syntax-only" or "dotnet lint"?

I would prefer not to install a separate linter if I don't have too.

I want to write out the warnings from the compiler in a separate stage of my CI pipeline so my devs will actually pay attention to them lol. Thank you!
Was this page helpful?