Skip to content

Commit 78b1bc4

Browse files
author
Callie Callaway
committed
Tighten the schema for no-redundant-roles
1 parent ea16854 commit 78b1bc4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/rules/no-redundant-roles.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,27 @@ import includes from 'array-includes';
1414
import has from 'has';
1515
import type { JSXOpeningElement } from 'ast-types-flow';
1616
import type { ESLintContext } from '../../flow/eslint';
17-
import { generateObjSchema } from '../util/schemas';
1817
import getExplicitRole from '../util/getExplicitRole';
1918
import getImplicitRole from '../util/getImplicitRole';
2019

2120
const errorMessage = (element, implicitRole) =>
2221
`The element ${element} has an implicit role of ${implicitRole}. Defining this explicitly is redundant and should be avoided.`;
2322

24-
const schema = generateObjSchema();
25-
2623
module.exports = {
2724
meta: {
2825
docs: {
2926
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-redundant-roles.md',
3027
},
31-
schema: [schema],
28+
schema: [{
29+
type: 'object',
30+
additionalProperties: {
31+
type: 'array',
32+
items: {
33+
type: 'string',
34+
},
35+
uniqueItems: true,
36+
},
37+
}],
3238
},
3339

3440
create: (context: ESLintContext) => {

0 commit comments

Comments
 (0)