From cc2c3d1d7e37461daf0a4618bbca3b640301c92e Mon Sep 17 00:00:00 2001 From: Sarah Harris Date: Wed, 9 Jul 2025 14:53:09 -0400 Subject: [PATCH 1/9] Adds custom config option for no-static-element-interactions to allow attributes that render down to specific native ones --- .../no-static-element-interactions-test.js | 21 ++++++++++ src/rules/no-static-element-interactions.js | 3 +- src/util/isInteractiveElement.js | 42 ++++++++++++++++++- 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/__tests__/src/rules/no-static-element-interactions-test.js b/__tests__/src/rules/no-static-element-interactions-test.js index fa1705651..5024b5e2b 100644 --- a/__tests__/src/rules/no-static-element-interactions-test.js +++ b/__tests__/src/rules/no-static-element-interactions-test.js @@ -29,11 +29,25 @@ const expectedError = { const ruleName = 'no-static-element-interactions'; +const customOptions = [{ + a: { + attributes: { + href: ['to', 'href'], + }, + }, + button: { + attributes: { + onClick: ['onClick', 'handleClick'], + }, + }, +}]; + const componentsSettings = { 'jsx-a11y': { components: { Button: 'button', TestComponent: 'div', + Link: 'a', }, }, }; @@ -82,6 +96,10 @@ const alwaysValid = [ { code: '