@movable/template-lint-plugin
v4.0.0
Published
[![CI](https://github.com/movableink/template-lint-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/movableink/template-lint-plugin/actions/workflows/ci.yml)
Downloads
213
Maintainers
Keywords
Readme
@movable/template-lint-plugin
This is a collection of custom ember-template-lint
rules written for and used at Movable Ink.
Rules
| Name | Description |
| :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| no-expression-like-strings
| Catch strings that you probably meant to be Handlebars expressions |
| no-forbidden-elements
| Catch <b>, <i>
that you probably meant to be <strong>, <em>
expressions |
| require-purgeable-class-names
| Require class names are written such that they can be detected by PurgeCSS |
Configurations
The following sets of rules are available for your ember-template-lint
configuration to extend from:
| Name | Description |
| :-------------------------- | :--------------------------------------------------------------------- |
| avoid-possible-typos
| Rules meant to catch possible typos in your templates |
| avoid-deprecated-elements
| Rules meant to catch <b>
and <i>
tags, use <strong>
and <em>
|
| svg-aria-required
| Rules meant to catch svgs without an aria-label
or aria-labelledby
|
| base
| The base set of rules used across all Movable Ink projects |
Usage
Start with installing this package into your Ember application
yarn add -D @movable/template-lint-plugin
Then, include the plugin in your .template-lintrc.js
// .template-lintrc.js
module.exports = {
plugins: ['@movable/template-lint-plugin'],
extends: [
// You can extend a whole set of rules
'@movable/template-lint-plugin:avoid-possible-typos',
'@movable/template-lint-plugin:avoid-deprecated-elements',
'@movable/template-lint-plugin:svg-aria-required',
],
rules: [
// ... Or just the ones you want
('no-expression-like-strings': true),
],
};