Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.56 KB

File metadata and controls

59 lines (41 loc) · 1.56 KB

ember/template-no-deprecated

Disallows using components, helpers, or modifiers that are marked @deprecated in their JSDoc.

This rule requires TypeScript (parserServices.program must be present). It is a no-op in plain .gjs files because cross-file import deprecations require type information.

Rule Details

This rule checks if imported Glimmer components, helpers, or modifiers are marked @deprecated in their JSDoc.

Covered syntax:

Template syntax Example
Component element <DeprecatedComponent />
Helper / value mustache {{deprecatedHelper}}
Block component {{#DeprecatedBlock}}…{{/DeprecatedBlock}}
Modifier <div {{deprecatedModifier}}>
Component argument <MyComp @deprecatedArg={{x}}>

Examples

Given a module:

// deprecated-component.ts
/** @deprecated use NewComponent instead */
export default class DeprecatedComponent {}

Examples of incorrect code for this rule:

import DeprecatedComponent from './deprecated-component';

<template>
  <DeprecatedComponent />
</template>
import { deprecatedHelper } from './deprecated-helper';

<template>
  {{deprecatedHelper}}
</template>

Examples of correct code for this rule:

import NewComponent from './new-component';

<template>
  <NewComponent />
</template>