-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Type definitions #48
Type definitions #48
Conversation
This comment has been minimized.
This comment has been minimized.
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 @uetchy!
Could you add dtslint
type tests? (see remarkjs/remark-rehype#13, or any of the other typing PRs for an example)
packages/remark-math/package.json
Outdated
"dependencies": {}, | ||
"devDependencies": {}, | ||
"peerDependencies": { | ||
"unified": "^9.0.0" |
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.
remark/unified generally doesn't use peerDependencies, they can cause trouble.
Generally dependencies
or devDependencies
are used.
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.
ok. I'll move it to dependencies.
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.
Sorry, I want to reopen this!
While I think including a package for types is fine (e.g., types/hast, vfile). I don’t think we should do it for unified. I think it should be removed from dependencies, and a note added in the readme that they should be installed (although: plugins don’t make sense w/o unified, so they probably always are installed).
@ChristianMurphy I think all issues you mentioned are resolved now. |
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 @uetchy !
Would it be possible to add some simple type tests for dtslint?
Something simple like:
unified().use(rehypeKatex);
unified().use(rehypeKatex, {output: 'html'});
// $ExpectError
unified().use(rehypeKatex, {noteARealOption: true});
for each typing
Generally that is used when settings are generic. |
@ChristianMurphy Added type test for each package! |
To fix `npm test`
Co-authored-by: Christian Murphy <[email protected]>
packages/remark-math/package.json
Outdated
"dependencies": {}, | ||
"devDependencies": {}, | ||
"peerDependencies": { | ||
"unified": "^9.0.0" |
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.
Sorry, I want to reopen this!
While I think including a package for types is fine (e.g., types/hast, vfile). I don’t think we should do it for unified. I think it should be removed from dependencies, and a note added in the readme that they should be installed (although: plugins don’t make sense w/o unified, so they probably always are installed).
add eslint-disable line to suppress dtslint error ref: remarkjs#48 (comment)
Any news? |
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.
The changes generally look good, but I’m not a fan of the changes to the ordering of package.json props. Could you revert those?
add eslint-disable line to suppress dtslint error ref: remarkjs#48 (comment)
Co-authored-by: Titus <[email protected]>
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.
B-E-A-UTIFUL!
Thanks @uetchy, released!!! ✨ |
Summary
Fixes #47
Added
.d.ts
file to each package.Discussion
options
have index signature[index: string]: unknown
asunified.Settings
did?{position: boolean}
{position: boolean}
to the definition files..use({settings: {position: false}})
to the end of the chain.