Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Testing #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Testing #78

wants to merge 3 commits into from

Conversation

brettz9
Copy link

@brettz9 brettz9 commented May 27, 2020

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, and jest's coverage doesn't seem to pick up the transform 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 running jest --coverage adds files to coverage.

Anyways, for what it's worth--wasn't digging too deeply, just in case you want...

insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
Copy link
Owner

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.

Copy link
Author

@brettz9 brettz9 May 27, 2020

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).

Copy link
Owner

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atom

Copy link
Author

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.

Copy link
Owner

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.

Copy link
Author

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants