You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ember-cli-typescript

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-typescript

Allow ember apps to use typescript files.

1.0.0-beta.2
Source
npmnpm
Version published
Weekly downloads
540K
-11.14%
Maintainers
3
Weekly downloads
 
Created

What is ember-cli-typescript?

ember-cli-typescript is an addon for Ember.js that enables TypeScript support in Ember applications. It provides a seamless integration of TypeScript into the Ember build pipeline, allowing developers to write their Ember code in TypeScript, which offers static type checking and other benefits.

What are ember-cli-typescript's main functionalities?

TypeScript Integration

This feature allows you to write Ember components using TypeScript. The code sample demonstrates a simple Glimmer component written in TypeScript, with type annotations for the component's arguments.

import Component from '@glimmer/component';

interface MyComponentArgs {
  name: string;
}

export default class MyComponent extends Component<MyComponentArgs> {
  get greeting(): string {
    return `Hello, ${this.args.name}!`;
  }
}

Type Checking

Type checking ensures that the types of the arguments passed to components are correct. The code sample shows a type error when an incorrect type is passed to the component.

import Component from '@glimmer/component';

interface MyComponentArgs {
  name: string;
}

export default class MyComponent extends Component<MyComponentArgs> {
  get greeting(): string {
    return `Hello, ${this.args.name}!`;
  }
}

// This will cause a type error
let component = new MyComponent({ name: 123 });

TypeScript Configuration

This feature allows you to configure TypeScript settings for your Ember project. The code sample shows a typical tsconfig.json file used to configure the TypeScript compiler options and include paths.

{
  "compilerOptions": {
    "target": "es6",
    "module": "esnext",
    "strict": true,
    "noImplicitAny": true,
    "moduleResolution": "node",
    "baseUrl": ".",
    "paths": {
      "*": ["types/*"]
    }
  },
  "include": [
    "app/**/*",
    "tests/**/*"
  ]
}

Other packages similar to ember-cli-typescript

Keywords

ember-addon

FAQs

Package last updated on 29 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts