-
Notifications
You must be signed in to change notification settings - Fork 214
IDE: vscode
Jennifer Konikowski edited this page May 6, 2021
·
8 revisions
-
Install the Ruby extension
-
Enable the Ruby language server in your settings:
-
The Ruby:Lint option will direct you to the
settings.json
file:Enable standard linting by adding the following:
"ruby.lint": { "standard": true }
-
Reload your window to enable the language server and linting. You can confirm that linting is happening by selecting the "Ruby Language Server" in the Output tab.
You can view the ruby extension docs for more configuration options, like defaulting to the bundler-installed version of standard:
"ruby.lint": {
"standard": {
"useBundler": true,
}
}
- To enable Standard to fix your code on save, you can use the Run on Save extension, configured in your settings.json:
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.rb$",
"cmd": "standardrb --fix"
}
]
}
NOTE: This will fix every file. To fix only the current file, change the above to:
"cmd": "standardrb --fix ${file}"