npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-template-lint

v6.0.0

Published

Linter for Ember or Handlebars templates.

Downloads

531,248

Readme

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

| | Name | Description | | :-- | :--------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ✅ | recommended | Enables the recommended rules. | | 💅 | stylistic | Enables 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). | | ⌨️ | a11y | Enables 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-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-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-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-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-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-title | ✅ | | ⌨️ | | | require-input-label | ✅ | | ⌨️ | | | require-lang-attribute | ✅ | | ⌨️ | | | require-mandatory-role-attributes | ✅ | | ⌨️ | | | require-media-caption | ✅ | | ⌨️ | | | require-presentational-children | ✅ | | ⌨️ | | | require-splattributes | | | | | | require-valid-alt-text | ✅ | | ⌨️ | | | require-valid-named-block-naming-format | ✅ | | | 🔧 | | self-closing-void-elements | | 💅 | | 🔧 | | simple-modifiers | ✅ | | | | | simple-unless | ✅ | | | 🔧 | | 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.