-
Notifications
You must be signed in to change notification settings - Fork 55
Testing #78
base: master
Are you sure you want to change the base?
Testing #78
Conversation
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use prettier defaults in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I don't know of any functional IDE tools which leverage existing config from projects like prettier (or ESLint which has a prettier plugin) so as to do pre-linting--i.e., to set the proper indent immediately after hitting return (rather than linting on save, along with other fixes). EditorConfig, on the other hand, is well supported (and works with non-JS also).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of any functional IDE tools
Any IDE support them. Via plugins or builtin. Even VIM. Which IDE do you use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Atom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I am referring to project-aware setting of the indent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://atom.io/packages/prettier-atom
Many projects in js community use prettier. Adding editorconfig is adding another tool for formatting by your personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, and I am aware of that Atom plugin (I have it installed). But note how it says, "format on save". It makes the changes either manually or when you save. It doesn't know instantly when you hit enter that it should immediately indent to the proper number of spaces or tabs. The EditorConfig plugin does do this.
Anyways, not a big deal, and your call of course. But EditorConfig currently fills a different purpose than Prettier, at least given the absence of tools which set the indent immediately upon hitting enter, and not waiting until save. There are plenty of projects which use both EditorConfig and ESLint, for example, even though both having settings for indent spaces. Ideally, ESLint tools would do so, but the only solution I've seen ( https://github.com/stuart-williams/eslint-tab-length ) does not work too well for me (it toggles the system default).
FWIW, in checking out your tests, including
jest --coverage
, I saw there were a few small uncovered else cases (there is still one more else case after this, andjest
's coverage doesn't seem to pick up thetransform
calls).The
.editorconfig
is useful to allow proper setting of indent ahead of time in the IDE without having to toggle config.And the
.gitignore
change is since runningjest --coverage
adds files tocoverage
.Anyways, for what it's worth--wasn't digging too deeply, just in case you want...