Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

### Changed

- Handle non string literal role values and `role-has-required-aria-props` and non string literal value for `kind` attribute in `media-has-caption`.

## [0.5.1] - 2020-09-08

### Changed
Expand Down
4 changes: 3 additions & 1 deletion src/rules/__tests__/role-has-required-aria-props.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const makeRuleTester = require("./makeRuleTester");

makeRuleTester("role-has-required-aria-props", rule, {
valid: [
"<span role='checkbox' aria-checked='false' aria-labelledby='test' tabindex='0' />"
"<span role='checkbox' aria-checked='false' aria-labelledby='test' tabindex='0' />",
"<span :role='role' aria-checked='false' aria-labelledby='test' tabindex='0' />",
"<span :role='role' />"
],
invalid: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/rules/media-has-caption.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {

const isCaptionsTrackElement = (node) => {
const kind = getElementAttributeValue(node, "kind");
return kind && kind.toLowerCase() === "captions";
return kind && typeof kind === "string" && kind.toLowerCase() === "captions";
};

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/role-has-required-aria-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
}

const roleValue = getElementAttributeValue(node, "role");
if (!roleValue) {
if (!roleValue || typeof roleValue !== "string") {
return;
}

Expand Down