-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add TypeScript types #35
Conversation
It’s now applied on all files in the repository. HTML and markdown files are properly ignored.
/cc @Rokt33r |
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.
Thanks @remcohaszing!
I’d prefer not formatting JSON either, what do y’all think? |
@wooorm wrote:
I think Prettier should be used to format JSON, because it forces consistent formatting and very importantly, proper spacing, newlines, and a newline at the end of the file. Prettier supports 2 formatters for JSON: @wooorm’s preferred format matches "overrides": [
{
"files": [
"*.json"
],
"options": {
"parser": "json-stringify"
}
}
] Although I personally like Note that the Prettier |
Ah. Yeah. Overrides sounds silly. |
First off, nice work @remcohaszing!
I don’t think it matters a lot but I might be slightly inclined to not using Prettier on JSON as well. Mostly because the files, like @wooorm said, are fixtures or |
I don't have a strong opinion on the json formatting. 🤷 If this config were getting bundled into a |
I think running Prettier on the entire directory, instead of using a glob is the correct way of running it. Files are excluded using I reconfigured Prettier, because I needed it to format TypeScript files as well. I decided to format JSON as well, as the impact isn’t that big. Markdown is excluded, because All file of these file formats are formatted by Prettier. Excluding a specific file extension in Even if files are generated, people can mess with them before committing them, so I think it makes sense to validate any file if possible, especially if a file type is already supported by a tool that’s already in use. If you do have strong feelings about the JSON formatting, I’ll exclude it from syntax-tree/hast-util-from-parse5#10 and later this PR. Otherwise, I’ll wait on that PR, since this one depends on it. |
I, relatively strongly, would say that we should do a ‘.’ for prettier always, but would like to exclude through prettierignore: 1) gitignored files when needed, 2) markdown because we dog food our own, 3) HTML because it’s probably a fixture when needed, 4) json (if included). Everything else, yaml, TS, JS, etc., is probably handwritten and really benefits from formatting. I agree on formatting as important, but don’t think the churn of updating 100s of mostly generated files is worth it. |
friendly ping @remcohaszing |
This comment has been minimized.
This comment has been minimized.
@ChristianMurphy sorry, I have been busy unexpectedly lately. Anyway, the feedback is processed now. :) |
Released, thanks @remcohaszing and others! |
This add TypeScript types for the following packages:
rehype
rehype-parse
rehype-stringify
Also Prettier has been properly configured. It runs on the entire code base. Markdown and HTML files are ignored. Because of this, many JSON files have been touched.