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

@ember/template should be typed #342

Closed
2 tasks done
AvremelM opened this issue Oct 18, 2018 · 1 comment
Closed
2 tasks done

@ember/template should be typed #342

AvremelM opened this issue Oct 18, 2018 · 1 comment

Comments

@AvremelM
Copy link

AvremelM commented Oct 18, 2018

Which package(s) does this problem pertain to?

  • @types/ember__string
  • Other

What are instructions we can follow to reproduce the issue?

import { htmlSafe, isHTMLSafe } from '@ember/template';

let foo = "bar";
if (!isHTMLSafe(foo)){
  let safeFoo = htmlSafe(foo);
}

Now about that bug. What did you expect to see?

I expected no errors (except maybe an unused variable), and accurate typing for isHTMLSafe and htmlSafe.

What happened instead?

TypeScript complains Cannot find module '@ember/template'.

More information

htmlSafe and isHTMLSafe used to be in @ember/string, and can still in fact be imported from there. However, the correct location is in @ember/template, a module that hasn't been typed at all. The typings for these methods are still in @ember/string

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

No branches or pull requests

2 participants