Skip to content
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

Integrate types for the warn method #20224

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Integrate types for the warn method #20224

merged 2 commits into from
Jan 10, 2024

Conversation

r-52
Copy link
Contributor

@r-52 r-52 commented Oct 14, 2022

This PR consist of two commits (if they are okay, I can them squash them)

  1. Mention the id property in the options object of the warn method. The deprecate method mentions the sub-options properties and I tried to align the doc's for the warn method.
  2. integrate the Typescript types for the warn method. Right now, the test parameter can be used as a test-condition or as a shortcut for the options object to always display the warning. The options object itself is required for the warning.

What do you think?

@r-52 r-52 marked this pull request as draft October 14, 2022 18:15
@r-52 r-52 marked this pull request as ready for review October 15, 2022 17:26
Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

Thanks for opening this! One small tweak needed on the TS, and in fact this helps us catch an error in what the types here allowed!

packages/@ember/debug/lib/warn.ts Outdated Show resolved Hide resolved
packages/@ember/debug/lib/warn.ts Outdated Show resolved Hide resolved
@kategengler
Copy link
Member

@emberjs/typescript-core is this relevant?

@gitKrystan
Copy link
Contributor

@emberjs/typescript-core is this relevant?

It should be OK to merge with @chriskrycho's suggestions.

r-52 and others added 2 commits January 10, 2024 13:50
Mention the `id` parameter in the options object.
Co-authored-by: Chris Krycho <hello@chriskrycho.com>
@wagenet
Copy link
Member

wagenet commented Jan 10, 2024

I rebased and it turns out we'd already integrated most of the changes in other PRs. That said, there are some documentation improvements here that we could merge in.

@kategengler
Copy link
Member

Enabled auto-merge!

@kategengler kategengler merged commit a18f149 into emberjs:main Jan 10, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants