77// Requirements
88// -----------------------------------------------------------------------------
99
10- import includes from 'array-includes' ;
1110import { RuleTester } from 'eslint' ;
1211import { eventHandlers , eventHandlersByType } from 'jsx-ast-utils' ;
1312import { configs } from '../../../src/index' ;
@@ -270,15 +269,13 @@ ruleTester.run(`${ruleName}:recommended`, rule, {
270269 ...passReducer (
271270 interactiveRoles ,
272271 eventHandlers . filter (
273- handler => ! includes ( triggeringHandlers , handler ) ,
272+ handler => ! triggeringHandlers . includes ( handler ) ,
274273 ) ,
275274 codeTemplate ,
276275 ) ,
277276 ...passReducer (
278- interactiveRoles . filter ( role => ! includes ( recommendedRoles , role ) ) ,
279- eventHandlers . filter ( handler =>
280- includes ( triggeringHandlers , handler ) ,
281- ) ,
277+ interactiveRoles . filter ( role => ! recommendedRoles . includes ( role ) ) ,
278+ eventHandlers . filter ( handler => triggeringHandlers . includes ( handler ) ) ,
282279 tabindexTemplate ,
283280 ) ,
284281 ) ,
@@ -291,7 +288,7 @@ ruleTester.run(`${ruleName}:recommended`, rule, {
291288 ...neverValid ,
292289 ...failReducer ( recommendedRoles , triggeringHandlers , tabbableTemplate ) ,
293290 ...failReducer (
294- interactiveRoles . filter ( role => ! includes ( recommendedRoles , role ) ) ,
291+ interactiveRoles . filter ( role => ! recommendedRoles . includes ( role ) ) ,
295292 triggeringHandlers ,
296293 focusableTemplate ,
297294 ) ,
@@ -309,15 +306,13 @@ ruleTester.run(`${ruleName}:strict`, rule, {
309306 ...passReducer (
310307 interactiveRoles ,
311308 eventHandlers . filter (
312- handler => ! includes ( triggeringHandlers , handler ) ,
309+ handler => ! triggeringHandlers . includes ( handler ) ,
313310 ) ,
314311 codeTemplate ,
315312 ) ,
316313 ...passReducer (
317- interactiveRoles . filter ( role => ! includes ( strictRoles , role ) ) ,
318- eventHandlers . filter ( handler =>
319- includes ( triggeringHandlers , handler ) ,
320- ) ,
314+ interactiveRoles . filter ( role => ! strictRoles . includes ( role ) ) ,
315+ eventHandlers . filter ( handler => triggeringHandlers . includes ( handler ) ) ,
321316 tabindexTemplate ,
322317 ) ,
323318 ) ,
@@ -330,7 +325,7 @@ ruleTester.run(`${ruleName}:strict`, rule, {
330325 ...neverValid ,
331326 ...failReducer ( strictRoles , triggeringHandlers , tabbableTemplate ) ,
332327 ...failReducer (
333- interactiveRoles . filter ( role => ! includes ( strictRoles , role ) ) ,
328+ interactiveRoles . filter ( role => ! strictRoles . includes ( role ) ) ,
334329 triggeringHandlers ,
335330 focusableTemplate ,
336331 ) ,
0 commit comments