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
18 changes: 18 additions & 0 deletions __tests__/src/rules/has-accessibility-props-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@ ruleTester.run('has-accessibility-props', rule, {
{
code: '<div><TouchableOpacity accessible={true}/></div>;',
errors: [expectedError('TouchableOpacity')]
},
{
code: '<div><TouchableFoo accessible={true}/></div>;',
errors: [expectedError('TouchableFoo')],
options: [
{
touchables: ['TouchableFoo']
}
]
},
{
code: '<div><FooTouchable accessible={true}/></div>;',
errors: [expectedError('FooTouchable')],
options: [
{
touchables: ['FooTouchable']
}
]
}
].map(parserOptionsMapper)
});
7 changes: 0 additions & 7 deletions src/util/isTouchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ export default function isTouchable(
Object.prototype.hasOwnProperty.call(options[0], 'touchables')
) {
const { touchables } = options[0];
touchables.forEach(touchable => {
if (!touchable.startsWith('Touchable')) {
throw Error(
`Custom touchable specified in ${context.id} does not start with 'Touchable'`
);
}
});
extraTouchables = [...touchables];
}

Expand Down