- 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.