Skip to content
Stephen Laws edited this page Jul 22, 2022 · 5 revisions

JetBrains Rider Configuration

Code Formatting in JetBrains Rider

If using JetBrains Rider, you can use a code cleanup action to format C# and Razor files according to the project's code style. You can have Rider automatically perform this action whenever the file is manually saved.

You can also configure Rider to automatically format Vue and TypeScript files when they are saved, using eslint --fix, similar to how the Prettier extension works in VS Code.

Open the Rider settings (CTRL+ALT+S on Windows) and navigate to "Actions on Save" under "Tools". There, you can find the "Reformat and Cleanup Code" action and the "Run eslint --fix" action.

actions-on-save-initial

For the code cleanup, you'll want to select our customized profile labelled "HG Full Cleanup". It's configured to only apply changes to C# and Razor files.

To perform the eslint --fix action, you'll need to enable ESLint integration in Rider. There should be an "Enable ESLint..." link that takes you directly to these settings. Adjust them to enable automatic ESLint configuration for files with a "ts" or "vue" extension and to run eslint --fix on save.

eslint-configuration

If you click the "All actions on save..." link, you'll be returned to the settings page and you should now see both actions enabled.

actions-on-save-complete

Run Configurations

After opening the solution file, Rider will have run configurations created for each of the individual applications. During normal development, more than 1 project will need to be run at the same time. In order to do this you must create a compound run configuration by going to Run/Edit Configurations:

image

Then selecting Compound on the left nav and then clicking Add new run configuration on the main panel

image image

Give the Compound Configuration a name (HG Compound) and click the + on the left of the main panel and select a project.

image image

You will not have to customize any of the individual applications.

Repeat this process to add additional projects or new Run configurations.

Clone this wiki locally