-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove final newline based on file type? #4
Comments
Thanks @mhulse for your feedback! Yes, I think it's possible. I look at this ASAP. |
Oh, no rush on my behalf! Thinking out loud here:
Thanks so much for your consideration and for the plugin! |
Ok, then we should implement this setting, e.g. for JSON, JS and TS file extensions: {
"files.removeFinalNewlines.fileTypes": ["json", "js", "ts"]
} |
That looks awesome! I think this feature would really be a nice addition to this extension. I might have some time this weekend to possibly do a PR. I'll keep you posted. 👍 |
Wondering, would it make sense to have a blacklist/whitelist type of thing? So, whitelist would be extensions this plugin would work on, and blacklist would be extensions this plugin would ignore. This might give people more flexibility? Of course, I maybe be overthinking things here. |
Yes, nice! {
"files.removeFinalNewlines.fileTypes.include": ["json", "js", "ts"],
"files.removeFinalNewlines.fileTypes.exclude": ["md", "mdown", "log"]
} |
I think that's a winner. Was also wondering, would regex support be overkill? like [*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = false
indent_size = 4
indent_style = tab
[*.py]
indent_style = space
[*.{ini,json,rb,yml,sh,bash}]
indent_size = 2
indent_style = space
[.*rc]
indent_size = 2
indent_style = space
[{gemfile*,rakefile,vagrantfile}]
indent_size = 2
indent_style = space
[*.bat]
end_of_line = crlf
[cname]
insert_final_newline = false Or, |
No, I think it's no overkill, eventually an additional feature!? |
Sorry for being afk. I have actually been using IntelliJ as my primary code tool since I last filed this issue ... Apologies for not helping. :( Anyway, Looks like you got it solved! Nice work. :) |
No problem. Thanks Michael! |
Any chance this can, or could, work with an array of file extensions? I would like to remove all newlines from end of specific file types.
Thanks!
The text was updated successfully, but these errors were encountered: