Closed nicolas-brousse closed 4 years ago
Enforce to use single quotes on the code (default on rubocop)
I know it's the default on Rubocop but personally, I prefer to use double quotes. What do you think @florentferry?
I also prefer double, but since most of ruby dev seems to use single in OSS, I used single here to start. Just let me know your point of vue.
Ok for single quote.
Rails uses double quotes btw: https://github.com/rubocop-hq/rubocop/issues/5306#issuecomment-354273615
@nicolas-brousse after discussing it over lunch with @florentferry: we think we can stick with single-quotes, but it would be great to trigger rubocop --auto-correct
on the generated component directory (just after generating a component), so the partial is corrected with the project preferred style. What do you think?
Also it's not a behavior I already so in other generation system. May be it is for a good reason? (real question)
Rails generates project with double quotes, and generates scaffold with double quotes. If you install Rubocop with default config on top of that, you need to change several files from double quotes to single quote. Use rubocop with -a
option do the trick.
Also it's not a behavior I already so in other generation system. May be it is for a good reason? (real question)
It's a good question. I'm doing some research, I'll let you know if I find something.
I did not find any other library doing that.
Maybe we could add it as an option?
config.generators do |g|
g.komponent rubocop: true # this would be false by default
end
In this case rubocop -a
would be run after the generator.
What do you think?
I'm closing this stale PR, there are too many conflicts now. Feel free to reopen another one.
This PR does the following:
.editorconfig
file to try having all the same syntax on the projectrubocop
)eslint
)