standard
standard copied to clipboard
Editor support for Sublime Text
Get in touch with SublimeLinter and fork or extend SublimeLinter-rubocop
As a sublime text user, I'll take a crack at this :)
👏 👏 👏
Haven't submitted it to packagecontrol yet, but here's a first attempt that appears to be working First attempt
Unfortunately SublimeLinter doesn't support fix commands so we may want to create a separate plugin for formatting on save.
Cool! I wonder if @davemo has a chance to play with it
I got as far as cloning the recommended Sublime plugin repo, but haven't touched it otherwise.
The StandardRB linter plugin (https://github.com/testdouble/SublimeLinter-contrib-standardrb) was added to the SublimeLinter package control channel in https://github.com/SublimeLinter/package_control_channel/pull/90. There's an option in the plugin to let it play nice alongside the Rubocop linter. I'm sure there are still some rough edges (e.g. Some issues with paths on Windows) but I think it's a pretty stable first version.
To clarify (after talking with @davemo). This version shows linter errors in the buffer window but doesn't yet support auto formatting. SublimeLinter works on temp copies of files so there's more work to be done to fix/format the source in the buffer view.
It might be useful to see how PrettierJS handles this.
This config works for me using Sublime LSP:
{
"clients": {
"ruby": {
"enabled": true,
"command": ["standardrb", "--lsp"],
"selector": "source.ruby | text.html.ruby | source.ruby.rails",
"initializationOptions": {
"diagnostics": true
}
}
}