-
Notifications
You must be signed in to change notification settings - Fork 60
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: format code and markup #116
Conversation
It seems the build generates a bunch of Markdown files and also some JS/TS code. From what I can tell, Stencil, |
good point. I've also already thought about that. I think put autogenerated code under version control is not a bad idea at all. (js/ts)
But for the markdown files maybe they can be part of the gitignore file. At least for documentation/docs/Auto-generated because this files are a markdown output of the component-doc.json (packages/core) |
Alright, I can probably agree on versioning the auto-generated JS/TS code. But then it should be formatted using Prettier before being committed. I doesn't seem that Stencil supports some kind of post-generation command/hook for running Prettier. Perhaps an alternative solution is to use a pre-commit hook, e.g. a setup using Husky + lint-staged might help. Regarding the auto-generated docs, I've created a PR that removes them and adds the path to |
I guess one problem with versioning generated code is that you might end up with dead files at some point when the code generation changes and you don't remember to manually delete the obsolete files. |
Will be intergrated with #197 |
Summary
While scanning the code a bit, I noticed it's not consistently formatted using Prettier, although Prettier is used as the code formatter. So I ran Prettier on the entire repo with some ignored files and directories mainly taken from
.gitignore
.In some
.js
/.ts[x]
files, the imports weren't sorted properly, so I added the the packageprettier-plugin-organize-imports
which makes Prettier format imports using theorganizeImports
feature of the TypeScript language service API. I've used it in other projects in the past and it's a great plugin.While running Prettier, I saw it choking on
ix/packages/core/src/components/select/test/mode-multiple/index.html
Line 16 in 67ff008
which I've fixed (
<bodyp ...>
-><body>
) along the way, too.Sorry for the huge PR, but it's just tons of Prettier formatting changes.
How did you test this change?
There's not much to test, just formatting changes. 馃 that the CI checks pass. 馃槈