UNPKG

2.11 kBMarkdownView Raw
1# ember-cli-template-lint
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/rwjblue/ember-cli-template-lint.svg)](https://greenkeeper.io/)
4
5[![Build Status](https://travis-ci.org/rwjblue/ember-cli-template-lint.svg?branch=master)](https://travis-ci.org/rwjblue/ember-cli-template-lint)
6
7ember-cli-template-lint will lint your templates and add a test for each asserting
8that all style rules have been satisfied.
9
10For example, given the rule `bare-strings` is enabled, this template would be
11in violation:
12
13```hbs
14{{! app/components/my-thing/template.hbs }}
15<div>A bare string</div>
16```
17
18Thus a the test `TemplateLint: app/components/my-thing/template.hbs` would
19fail with the assertion "A bare string was found (0:5)".
20
21## Install
22
23To install ember-cli-template-lint
24
25```
26ember install ember-cli-template-lint
27```
28
29__Ember CLI >= 2.4.2 is required for linting templates__
30
31## Configuration
32
33ember-cli-template-lint is powered by [ember-template-lint](https://github.com/rwjblue/ember-template-lint)
34which allows configuration by using a `.template-lintrc.js` file in the root of your project.
35
36See [here](https://github.com/rwjblue/ember-template-lint/#rules) details on configuration and rules that are available.
37
38## Contributing
39
40A few ideas for where to take this in the future:
41
42* The list of rules should be configurable
43* This addon should use a test printer shared with jshint, eslint and jscs addons
44* A command-line version of the linter should be provided so IDEs and editors
45 can provide feedback to devs during development
46
47### Installation
48
49* `git clone` this repository
50* `npm install`
51* `bower install`
52
53### Running
54
55* `ember server`
56* Visit your app at http://localhost:4200.
57
58### Running Tests
59
60* `npm run nodetest`
61* `ember test`
62* `ember test --server`
63
64### Building
65
66* `ember build`
67
68For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
69
70## Troubleshooting
71
72If your files aren't linted make sure that you don't have the following option set in your `ember-cli-build.js`:
73```
74var app = new EmberApp(defaults, {
75 hinting: false
76});
77```