Skip to content

Fixes #23 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: node_js

sudo: false

cache:
directories:
- node_modules

node_js:
- 10
- 12

install: npm install

script:
- npm run lint
- npm run test

notifications:
email:
on_success: never
on_failure: change
5 changes: 3 additions & 2 deletions lib/rules/aria-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const VueUtils = require('eslint-plugin-vue/lib/utils');
const utils = require('../utils');
const altRule = require('eslint-plugin-jsx-a11y/lib/rules/aria-props.js');
const { generateObjSchema, arraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { generateObjSchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { aria } = require('aria-query');
const schema = generateObjSchema();

Expand All @@ -32,7 +32,8 @@ module.exports = {
}
context.report({
node,
message: `${name}: This attribute is an invalid ARIA attribute.`
message: `Attribute '{{name}}' is an invalid ARIA attribute.`,
data: { name }
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/aria-unsupported-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const VueUtils = require('eslint-plugin-vue/lib/utils');
const utils = require('../utils');
const altRule = require('eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements.js');
const { generateObjSchema, arraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { generateObjSchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { aria, dom } = require('aria-query');

const schema = generateObjSchema();
Expand All @@ -31,8 +31,8 @@ module.exports = {
if (invalidAttributes.indexOf(name) > -1) {
context.report({
node,
message: `This element does not support ARIA roles, states and properties.
Try removing the prop '${name}'.`
message: `This element does not support ARIA roles, states and properties. Try removing the prop '{{name}}'.`,
data: { name }
});
}
})
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/form-has-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

const VueUtils = require('eslint-plugin-vue/lib/utils');
const utils = require('../utils');
const { generateObjSchema, arraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { getProp, getPropValue, elementType, getLiteralPropValue } = require('jsx-ast-utils');
const { generateObjSchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { getProp, getPropValue, elementType } = require('jsx-ast-utils');

const errorMessage = 'Each form element must have a programmatically associated label element.';

Expand Down Expand Up @@ -93,4 +93,4 @@ module.exports = {
}
})
}
};
};
9 changes: 5 additions & 4 deletions lib/rules/interactive-supports-focus.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const VueUtils = require('eslint-plugin-vue/lib/utils');
const utils = require('../utils');
const altRule = require('eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus.js');
const { generateObjSchema, arraySchema, enumArraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { generateObjSchema, enumArraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { dom, roles } = require('aria-query');
const { eventHandlersByType } = require('jsx-ast-utils');
const errorMessage = '';


const schema = generateObjSchema({
Expand Down Expand Up @@ -56,13 +55,15 @@ module.exports = {
// Always tabbable, tabIndex = 0
context.report({
node,
message: `Elements with the '${role}' interactive role must be tabbable.`,
message: `Elements with the '{{role}}' interactive role must be tabbable.`,
data: { role }
});
} else {
// Focusable, tabIndex = -1 or 0
context.report({
node,
message: `Elements with the '${role}' interactive role must be focusable.`,
message: `Elements with the '{{role}}' interactive role must be focusable.`,
data: { role }
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-redundant-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ module.exports = {
}
context.report({
node,
message: `The element ${type} has an implicit role of ${implicitRole}. Defining this explicitly is redundant and should be avoided.`
message: `The element {{type}} has an implicit role of {{implicitRole}}. Defining this explicitly is redundant and should be avoided.`,
data: { type, implicitRole }
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/role-has-required-aria-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const VueUtils = require('eslint-plugin-vue/lib/utils');
const utils = require('../utils');
const altRule = require('eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props.js');
const { generateObjSchema, arraySchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { generateObjSchema } = require('eslint-plugin-jsx-a11y/lib/util/schemas.js');
const { dom, roles } = require('aria-query');

const errorMessage = (role, requiredProps) =>
Expand Down
Loading