https://github.com/movableink/template-lint-plugin
Custom `ember-template-lint` rules for Movable Ink
https://github.com/movableink/template-lint-plugin
Last synced: 6 months ago
JSON representation
Custom `ember-template-lint` rules for Movable Ink
- Host: GitHub
- URL: https://github.com/movableink/template-lint-plugin
- Owner: movableink
- Created: 2019-11-01T14:08:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T02:51:00.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T00:17:55.046Z (about 1 year ago)
- Language: JavaScript
- Size: 2.34 MB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# `@movable/template-lint-plugin`
[](https://github.com/movableink/template-lint-plugin/actions/workflows/ci.yml)
This is a collection of custom [`ember-template-lint`](https://github.com/ember-template-lint/ember-template-lint) rules written for and used at [Movable Ink](https://github.com/movableink).
## Rules
| Name | Description |
| :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| [`no-expression-like-strings`](./docs/rules/no-expression-like-strings.md) | Catch strings that you probably meant to be Handlebars expressions |
| [`no-forbidden-elements`][no-forbidden-elements-docs] | Catch `, ` that you probably meant to be `, ` expressions |
| [`require-purgeable-class-names`](./docs/rules/require-purgeable-class-names.md) | Require class names are written such that they can be detected by PurgeCSS |
| [`svg-aria-required`](./docs/rules/svg-aria-required.md) | Require all svgs to have aria label attributes |## 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 `` and `` tags, use `` and `` |
| `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
```sh
yarn add -D @movable/template-lint-plugin
```Then, include the plugin in your `.template-lintrc.js`
```javascript
// .template-lintrc.jsmodule.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),
],
};
```[no-forbidden-elements-docs]: https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-forbidden-elements.md#no-forbidden-elements