πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

ember-template-lint

Package Overview
Dependencies
Maintainers
7
Versions
239
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-template-lint

Linter for Ember or Handlebars templates.

latest
Source
npmnpm
Version
7.9.3
Version published
Weekly downloads
226K
3.8%
Maintainers
7
Weekly downloads
Β 
Created
Source

ember-template-lint

npm version Build Status

ember-template-lint is a library that will lint your handlebars template and return error results.

For example, if the rule no-bare-strings is enabled, this template would be in violation:

{{! app/components/my-thing/template.hbs  }}
<div>A bare string</div>

When the ember-template-lint executable is run, we would have a single result indicating that the no-bare-strings rule found an error.

Requirements

  • Node.js ^18.18.0 || ^20.9.0 || >=21.1.0

Installation

npm install --save-dev ember-template-lint
yarn add --dev ember-template-lint

Note: this library is installed by default with new Ember apps.

Usage

While ember-template-lint does have a Node API, the main way to use it is through its executable, which is intended to be installed locally within a project.

Basic usage is as straightforward as

ember-template-lint .

Workflow Examples

See documentation on workflow examples.

See documentation on the todo functionality.

Configuration

Project Wide

You can turn on specific rules by toggling them in a .template-lintrc.js file at the base of your project, or at a custom relative path which may be identified using the CLI:

module.exports = {
  extends: 'recommended',

  rules: {
    'no-bare-strings': true,
  },
};

For more detailed information see configuration.

Presets

NameDescription
βœ…recommendedEnables the recommended rules.
πŸ’…stylisticEnables stylistic rules for those who aren't ready to adopt ember-template-lint-plugin-prettier (including stylistic rules that were previously in the recommended preset in ember-template-lint v1).
⌨️a11yEnables A11Y rules. Its goal is to include all A11Y related rules, therefore it does not follow the same SemVer policy as the other presets. Please see versioning for more details.

Rules

Each rule has emojis denoting:

  • what configuration it belongs to
  • πŸ”§ if some problems reported by the rule are automatically fixable by the --fix command line option
Nameβœ…πŸ’…βŒ¨οΈπŸ”§
attribute-indentation
attribute-orderπŸ”§
block-indentationπŸ’…πŸ”§
builtin-component-argumentsβœ…
deprecated-inline-view-helperβœ…
deprecated-render-helperβœ…
eol-lastπŸ’…πŸ”§
inline-link-toπŸ”§
linebreak-styleπŸ’…
link-href-attributesβœ…βŒ¨οΈ
link-rel-noopenerβœ…πŸ”§
modifier-name-caseπŸ’…πŸ”§
no-abstract-rolesβœ…βŒ¨οΈ
no-accesskey-attributeβœ…βŒ¨οΈπŸ”§
no-actionβœ…
no-action-modifiersπŸ”§
no-action-on-submit-buttonβœ…
no-args-pathsβœ…
no-arguments-for-html-elementsβœ…
no-aria-hidden-bodyβœ…βŒ¨οΈπŸ”§
no-aria-unsupported-elementsβœ…βŒ¨οΈ
no-array-prototype-extensionsβœ…πŸ”§
no-at-ember-render-modifiersβœ…
no-attrs-in-componentsβœ…
no-autofocus-attributeβœ…βŒ¨οΈ
no-bare-strings
no-block-params-for-html-elementsβœ…
no-builtin-form-componentsβœ…
no-capital-argumentsβœ…
no-chained-thisπŸ”§
no-class-bindingsβœ…
no-curly-component-invocationβœ…πŸ”§
no-debuggerβœ…
no-duplicate-attributesβœ…βŒ¨οΈπŸ”§
no-duplicate-idβœ…βŒ¨οΈ
no-duplicate-landmark-elementsβœ…βŒ¨οΈ
no-dynamic-subexpression-invocations
no-element-event-actions
no-empty-headingsβœ…βŒ¨οΈ
no-extra-mut-helper-argumentβœ…
no-forbidden-elementsβœ…
no-heading-inside-buttonβœ…βŒ¨οΈ
no-html-commentsβœ…πŸ”§
no-implicit-thisβœ…
no-index-component-invocationβœ…
no-inline-stylesβœ…
no-input-blockβœ…
no-input-tagnameβœ…
no-invalid-aria-attributesβœ…βŒ¨οΈ
no-invalid-interactiveβœ…βŒ¨οΈ
no-invalid-link-textβœ…βŒ¨οΈ
no-invalid-link-titleβœ…βŒ¨οΈ
no-invalid-metaβœ…βŒ¨οΈ
no-invalid-roleβœ…βŒ¨οΈ
no-jsx-attributesπŸ”§
no-link-to-positional-paramsβœ…
no-link-to-tagnameβœ…
no-logβœ…
no-model-argument-in-route-templatesπŸ”§
no-multiple-empty-linesπŸ’…πŸ”§
no-mut-helper
no-negated-conditionβœ…πŸ”§
no-nested-interactiveβœ…βŒ¨οΈ
no-nested-landmarkβœ…βŒ¨οΈ
no-nested-splattributesβœ…
no-obscure-array-accessβœ…πŸ”§
no-obsolete-elementsβœ…βŒ¨οΈ
no-only-default-slotπŸ”§
no-outlet-outside-routesβœ…
no-partialβœ…
no-passed-in-event-handlersβœ…
no-pointer-down-event-bindingβœ…βŒ¨οΈ
no-positional-data-test-selectorsβœ…πŸ”§
no-positive-tabindexβœ…βŒ¨οΈ
no-potential-path-stringsβœ…
no-quoteless-attributesβœ…πŸ”§
no-redundant-fnβœ…πŸ”§
no-redundant-roleβœ…βŒ¨οΈπŸ”§
no-restricted-invocations
no-route-actionβœ…
no-scope-outside-table-headingsβœ…βŒ¨οΈ
no-shadowed-elementsβœ…
no-splattributes-with-class
no-this-in-template-only-componentsπŸ”§
no-trailing-spacesπŸ’…πŸ”§
no-triple-curliesβœ…
no-unbalanced-curliesβœ…
no-unboundβœ…
no-unknown-arguments-for-builtin-componentsβœ…πŸ”§
no-unnecessary-component-helperβœ…πŸ”§
no-unnecessary-concatπŸ’…πŸ”§
no-unnecessary-curly-parensβœ…πŸ”§
no-unnecessary-curly-stringsβœ…πŸ”§
no-unsupported-role-attributesβœ…βŒ¨οΈπŸ”§
no-unused-block-paramsβœ…
no-valueless-argumentsβœ…
no-whitespace-for-layoutβœ…βŒ¨οΈ
no-whitespace-within-wordβœ…βŒ¨οΈ
no-withβœ…
no-yield-block-params-to-else-inverse
no-yield-onlyβœ…
no-yield-to-defaultβœ…
quotesπŸ’…πŸ”§
require-aria-activedescendant-tabindexβœ…βŒ¨οΈ
require-button-typeβœ…πŸ”§
require-context-roleβœ…βŒ¨οΈ
require-each-key
require-form-method
require-has-block-helperβœ…πŸ”§
require-iframe-src-attributeπŸ”§
require-iframe-titleβœ…βŒ¨οΈ
require-input-labelβœ…βŒ¨οΈ
require-lang-attributeβœ…βŒ¨οΈ
require-mandatory-role-attributesβœ…βŒ¨οΈ
require-media-captionβœ…βŒ¨οΈ
require-presentational-childrenβœ…βŒ¨οΈ
require-splattributes
require-strict-mode
require-valid-alt-textβœ…βŒ¨οΈ
require-valid-form-groups
require-valid-named-block-naming-formatβœ…πŸ”§
self-closing-void-elementsπŸ’…πŸ”§
simple-modifiersβœ…
simple-unlessβœ…πŸ”§
sort-invocationsπŸ”§
splat-attributes-onlyβœ…
style-concatenationβœ…
table-groupsβœ…βŒ¨οΈ
template-length

Supporting the --fix option

You can add a fixer to a rule. See fixer documentation for more details.

Sharing configs

It is possible to share a config (extends) or plugin (custom rules) across projects. See ember-template-lint-plugin-peopleconnect for an example.

Defining your own rules

You can define and use your own custom rules using the plugin system. See plugin documentation for more details.

Semantic Versioning Policy

The semver policy for this addon can be read here: semver policy.

Contributing

See the Contributing Guidelines for information on how to help out.

License

This project is licensed under the MIT License.

Keywords

ember

FAQs

Package last updated on 15 Aug 2025

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