- Ensure that the configuration objects are not mutated.
- Add new
quotes
rule. Examples:
Enforce either:
or:
You can read more about the rule in the documentation.
- Ensure packages required by the executable script are dependencies. This fixes issues when using
ember-template-lint
as a globally installed package.
- Fix issue with
attribute-indentation
rule (reporting incorrect indentation for multiple valid invocations).
- Add new
no-trailing-spaces
rule. Examples:
Bad:
Good:
You can read more about the rule in the documentation.
- Add new
eol-last
rule. Examples:
Enforce either:
or:
You can read more about the rule in the documentation.
- Add support for
colgroup
andcaption
totable-groups
rule. - Colorize the error severity in the console output.
- Add new
table-groups
rule. Examples:
The rule forbids the following:
Instead, you should write your table as:
You can read more about the rule in the documentation.
- Ensure that the contents of else blocks (a.k.a.
inverse
blocks) are checked for indentation.
- Fix error in
simple-unless
rule when an{{if
or{{unless
block was empty.
- Add new
template-length
rule. When enabled, this rule restricts the total number of lines in a template file to the configured number. You can read more about the rule (and configuration) in the documentation.
- Add new
attribute-indentation
rule. Examples:
You can read more about the rule (and configuration) in the documentation.
- Update @glimmer packages to 0.27.0.
- Update
block-indentation
rule to allow{{#if foo}}stuff{{else}}stuff{{/if}}
. - Fix error being thrown by
linebreak-style
rule when dynamic attributes were being used (e.g.<img alt="example" src={{some/thing here}}>
).
- Add new rule
no-duplicate-attributes
to prevent duplicating the same attributes in a single mustache/block/element. Read the documentation for more details. - Add new rule
linkbreak-style
to ensure all templates use the same style of linebreaks throughout the template. Read the documentation for more details.
- Fix issue with console output formatting to avoid noisy console output when no errors are present.
- Refactor the console output formatter to be a much closer match to ESLint output (changes the signature of
Linter.errorsToMessages
).
- Cleanup dependencies (remove unused, update versions to latest, etc).
- Move rule documentation out of the
README.md
and intodocs/rules/<rule-name>.md
to make it simpler to reason about and link to documentation by rule. - Add
require
as an option toself-closing-void-elements
. Use this value if you would like to require that all void elements are self closing (e.g. you require<img />
).
- Move
strip-bom
todependencies
(was mistakenly adevDependency
).
- Prevent errors when using contextual components.
- Prevent errors within the
bare-strings
rule for<input placeholder="{{foo}}.">
-
Add support for user supplied rules and configuration. Please review the documentation for more details.
-
Add
ember-template-lint
command line script. This enable much easier running of the linter from the command line, editor plugins, etc. Supports--json
flag to enable easier consumption by tools. See documentation for more details. -
Allow
rel=noreferrer
to satisfy thelink-rel-noopener
rule. -
Add
inline-styles
rule, which forbids using thestyle
attribute in HTML elements. -
Drop support for Node < 4.
-
Fix a number of issues with
block-indentation
rule when using "whitespace control" characters (e.g.{{~if foo~}}
). -
Add support for globs in
.template-lintrc.js
'signore
option. -
Add
simple-unless
rule which forbids using{{unless
with an inverse (or from an inverse), and with complex helper invocations as the predicate. -
Add
simple-unless
to the recommended configuration. -
Allow
<form onsubmit={{action 'foo'}}></form>
from theinvalid-interactive
rule. -
Remove
deprecated-each-syntax
fromrecommended
config. -
Add configurable option to
link-rel-noopener
to require bothnoopener
andnoreferrer
. See the documentation for more details. -
Update to leverage ES2015 features that are supported in Node 4.
-
Added
no-log
andno-debugger
rules. These rules forbid usage of{{log}}
and{{debugger}
helpers, which should be used only for local debugging and never checked in. -
Fix issues around templates including a Byte Order Mark.
-
Upgrade underlying engine to leverage
@glimmer/compiler@0.25.1
. Includes much smaller footprint, better location support, easier to use plugin API. -
Change API around
Rule
definition. A simpleclass extends Rule { }
is all that is required.
-
Add support for Handlebars comments.
A few new types of control statements are now available:
{{! template-lint-enable some-rule-name }}
- This will enable the rulesome-rule-name
with the default configuration (from.template-lintrc.js
) ortrue
(if not present in the config file). This can be ran for multiple rules at once (i.e.{{! template-lint-enable bare-strings some-other-thing }}
).{{! template-lint-disable some-rule-name }}
- This will disable the rulesome-rule-name
. Multiple rules can be provided at once (i.e.{{! template-lint-disable bare-strings some-other-thing }}
).{{! template-lint-configure some-rule-name { "whitelist": ["some", "valid", "json"] } }}
- This configures the rulesome-rule-name
with theJSON.parse()
'ed result of the second argument. The configure instruction only applies toa single rule at a time.
These configuration instructions do not modify the rule for the rest of the template, but instead only modify it within whatever DOM scope the comment instruction appears.
An instruction will apply to all later siblings and their descendants:
An in-element instruction will apply to only that element:
An in-element instruction with the -tree suffix will apply to that element and all its descendants:
-
Deprecate using HTML comments for enabling/disabling rules. Support for HTML comments will be removed in v0.7.0.
- Add
ignore
to allowed configuration values.ignore
is an array of moduleId's that are to be completely ignored. This is similar (but different) frompending
. - Add
unused-block-params
rule. The following example would fail this rule (since it has an unused block paramindex
):
- Update
img-alt-attributes
rule to allow<img alt>
and<img alt="">
. - Update
invalid-interactive
rule to allow<form {{action 'foo' on="submit"}}>
.
- Fix issue with new
deprecated-inline-view-helper
(throwing error when parsing mustache statements).
- Add
invalid-interactive
to recommended rules. - Add
img-alt-attributes
to recommended rules. - Add
style-concatenation
to recommended rules. - Add
deprecated-inline-view-helper
to recommended rules. - Add
link-rel-noopener
to recommended rules. - Remove support for Node 0.10.
- Add
deprecated-inline-view-helper
rule. Usage of{{view
/{{#view
helper and{{view.path.here}}
were deprecated in Ember 1.13, and subsequently removed in Ember 2.0. This rule flags these usages.
- Fix issue with the
invalid-interactive
rule not honoring the documentedadditonalInteractiveTags
option.
- Fix issue with
link-rel-noopener
rule when using properly with a listing (i.e.rel="noopener noreferrer"
). - Add
inline-link-to
rule to prevent usage of inline{{link-to
. - Add
style-concatenation
rule. This prevents the usage of<div style="{{make-background url}}">
(quoted value with any dynamic segments) but allows<div style={{make-background url}}>
.
- Fix issue causing
<iframe>
to be detected as{{#if
. - Add
link-rel-noopener
rule. This rule requires that any<a target="_blank">
have arel="noopener"
. This prevents the newly opened window from having access to the opener (and helps prevent a number of phishing attacks).
- Fix
invalid-indentation
rule to allow scenarios where the opening and closing elements can have no space between. For example:
If the above </textarea>
had been after a newline and indented properly, the default contents of the textarea would then include that whitespace. The rule now enforces
that there be no child elements within a given block.
- Remove a few ARIA roles that were incorrectly flagging things as interactive elements (i.e.
dialog
andalertdialog
).
- Fix bug with
invalid-interactive
rule incorrectly flagging valid elements.
-
Change
nested-interactive
rule to ignore elements usingtabindex
when determining if a parent element is interactive.tabindex
is still used for detecting all child elements once already inside of another interactive element. -
Fix various issues with
nested-interactive
and<label>
.- Consider
<label>
an interactive element. - Specifically handle the various edge cases of having
<label><input></label>
. - Prevent multiple interactive elements inside of a
<label>
.
- Consider
-
Fix bugs with the
invalid-indentation
around escaped mustaches and raw blocks. -
Add
invalid-interactive
rule (full documentation). Adding interactivity to an element that is not naturally interactive content leads to a very poor experience for users of assistive technology (i.e. screen readers). In order to ensure that screen readers can provide useful information to their users, we should add an appropriaterole
attribute when the underlying element would not have made that role obvious.This rule forbids the following:
Instead, you should add a role
to the element in question so that the A/T is aware that it is interactive:
-
Add
img-alt-attributes
rule (full documentation). An<img>
without analt
attribute is essentially invisible to assistive technology (i.e. screen readers). In order to ensure that screen readers can provide useful information, we need to ensure that all<img>
elements have analt
specified. See WCAG Suggestion H37.The rule forbids the following:
Instead, you should write the template as:
- Add internal helper for determining if a given element is an interactive element.
- Update
nested-interactive
rule to use the newisInteractiveElement
helper function. - Change
nested-interactive
configuration. Now uses an object (instead of an array). Example:
rules: {
'nested-interactive': {
ignoredTags: ['a', 'button'], // list of tag names to ignore
ignoreTabindex: true, // ignore the tabindex check
ignoreUsemapAttribute: ['img', 'object'], // ignore `usemap` check for specific tag names
additionalInteractiveTags: ['some-custom-tag'], // not sure this is needed, but it seams neat :P
}
}
- Add ability to mark specific rules as pending for a module. Given the following
.template-lintrc.js
file, thefoo/bar/baz
module would have only its indentation related issues labeled as warnings:
module.exports = {
extends: 'recommended',
pending: [
{ moduleId: 'foo/bar/baz', only: ['block-indentation']}
]
}
All other rules with errors in the foo/bar/baz
template would still be reported as errors.
- Update internals to use better API for traversing nodes in template AST.
- Lock down parser version (should make package more stable as loose deps won't break consumers).
- Fix various issues with
block-indentation
rule:- Ensure that usage of whitespace control in end block does not trigger an error. Before this:
{{#if foo}}{{~/if}}
would error. - Validate indentation for block inverse (aka
{{else}}
).
- Ensure that usage of whitespace control in end block does not trigger an error. Before this:
- Fix a bug with
block-indentation
rule that would throw an error if a block contained a comment. - Fixed bugs upstream in HTMLBars that caused location information to be incorrect for attributes and comments.
- Remove
bare-strings
fromrecommended
configuration. See #27 for more details.
- Fix invalid rule name in
recommended
configuration. - Add ability to mark files as
pending
in the.template-lintrc.js
configuration file. When a module is listed in thepending
list, it will be checked but any errors detected will be marked as warnings (and will not trigger a failing test when using ember-cli-template-lint). If there are no errors detected when checking a pending file, a new error will be triggered. The goal of this process is to allow large existing projects begin utilizingember-template-lint
/ember-cli-template-lint
and slowly fix their template files to comply with the rules here. Feedback welcome on this idea/process...
-
Move rule configuration into
rules
property inside.tempalte-lintrc.js
. Configuration in the root is still supported, but triggers a deprecation warning. Migration should be very straigtforward.Before:
// .template-lintrc.js module.exports = { 'bare-strings': true }
After:
// .template-lintrc.js module.exports = { rules: { 'bare-strings': true } }
- Add ability to extend from internally managed configurations.
- Add
recommended
configuration, which can be used via the following in your.template-lintrc.js
:
module.exports = {
extends: 'recommended'
}
- Add
fix
information to the results object for:html-comments
self-closing-void-elements
deprecated-each-syntax
- Add support for context shifting
{{#each
(i.e.{{#each posts}}
) to thedeprecated-each-syntax
.
- Bring back rules lost during migration from ember-cli-template-lint (deprecated-each, self-closing-void-elements).
- Initial migration of plugins from ember-cli-template-lint.
- Implement new node API for the Linter.
- Implement new result objects.