Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Add types #18

Merged
merged 7 commits into from Aug 22, 2020
Merged

Add types #18

merged 7 commits into from Aug 22, 2020

Conversation

pd4d10
Copy link
Contributor

@pd4d10 pd4d10 commented Aug 18, 2020

No description provided.

@pd4d10
Copy link
Contributor Author

pd4d10 commented Aug 18, 2020

https://travis-ci.org/github/remarkjs/remark-external-links/jobs/718949083#L235

  types/index.d.ts:3:22
  ✖  3:22  unified should be listed in the project's dependencies. Run npm i -S unified to add it  import/no-extraneous-dependencies

Shall we add it to dependencies or disable this rule?

types/index.d.ts Outdated Show resolved Hide resolved
@ChristianMurphy ChristianMurphy requested a review from a team August 18, 2020 14:27
@ChristianMurphy ChristianMurphy added ☂️ area/types This affects typings 🦋 type/enhancement This is great to have 🧑 semver/major This is a change labels Aug 18, 2020
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
@ChristianMurphy
Copy link
Member

Shall we add it to dependencies or disable this rule?

I'll defer to @wooorm on this one, IIRC the current preference is to disable this rule.

pd4d10 and others added 3 commits August 19, 2020 11:16
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
@codecov-commenter

This comment has been minimized.

@pd4d10
Copy link
Contributor Author

pd4d10 commented Aug 19, 2020

Another question, should RemarkExternalLinksOptions be exposed to users?

@ChristianMurphy
Copy link
Member

ChristianMurphy commented Aug 19, 2020

Another question, should RemarkExternalLinksOptions be exposed to users?

Yes, unified/remark plugins often depend on each other, having options exported/on the namespace allows reuse.

Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

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

lgtm, with RemarkExternalLinksOptions!

@pd4d10
Copy link
Contributor Author

pd4d10 commented Aug 19, 2020

Another question, should RemarkExternalLinksOptions be exposed to users?

Currently we use export = remarkExternalLinks and could not do something like export { RemarkExternalLinksOptions } any more. Is there any best practice for this case?

@ChristianMurphy
Copy link
Member

There is,
export = is needed to ensure that the types work when https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports is false.
to allow an interface to also be included use a namespace that matches the export.

For example https://github.com/remarkjs/remark-frontmatter/blob/main/types/index.d.ts#L5 and https://github.com/remarkjs/remark-frontmatter/blob/3414a84ef27ead52701cae985994f67f17b414da/types/index.d.ts#L61-L63

@pd4d10
Copy link
Contributor Author

pd4d10 commented Aug 19, 2020

@ChristianMurphy Get it. Updated

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

thanks @pd4d10! 🙇

types/index.d.ts Outdated Show resolved Hide resolved
@wooorm wooorm merged commit 2b792ab into remarkjs:main Aug 22, 2020
@wooorm
Copy link
Member

wooorm commented Aug 22, 2020

Thanks @pd4d10, released in 7.0.0!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

5 participants