Skip to content

@ember/template should be typed #342

Closed

Description

@AvremelM

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

Activity

  1. jamescdavis commented on Oct 11, 2019

    @jamescdavis
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions