From e3e7d5ebee51bd0c6d70448b8354d2e543f45c1a Mon Sep 17 00:00:00 2001 From: Scott Gould Date: Thu, 4 Jan 2024 14:15:54 -0500 Subject: [PATCH] Relax href-or-on-click rule to warning --- packages/eslint-plugin/index.js | 2 +- packages/eslint-plugin/rules/href_or_on_click.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/index.js b/packages/eslint-plugin/index.js index e82fb4dfead..9f0f55cc85f 100644 --- a/packages/eslint-plugin/index.js +++ b/packages/eslint-plugin/index.js @@ -25,7 +25,7 @@ module.exports = { recommended: { plugins: ['@elastic/eslint-plugin-eui'], rules: { - '@elastic/eui/href-or-on-click': 'error', + '@elastic/eui/href-or-on-click': 'warn', }, }, }, diff --git a/packages/eslint-plugin/rules/href_or_on_click.js b/packages/eslint-plugin/rules/href_or_on_click.js index e0960ae1f65..7109e693159 100644 --- a/packages/eslint-plugin/rules/href_or_on_click.js +++ b/packages/eslint-plugin/rules/href_or_on_click.js @@ -24,7 +24,7 @@ module.exports = { if (hasHref && hasOnClick) { context.report( node, - `<${node.name.name}> accepts either \`href\` or \`onClick\`, not both.` + `<${node.name.name}> supplied with both \`href\` and \`onClick\`; is this intentional? (Valid use cases include programmatic navigation via \`onClick\` while preserving "Open in new tab" style functionality via \`href\`.)` ); } },