Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-smarthr

Package Overview
Dependencies
Maintainers
24
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-smarthr - npm Package Compare versions

Comparing version 0.5.6 to 0.5.7

rules/a11y-replace-unreadable-symbol/index.js

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # Changelog

### [0.5.7](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.6...v0.5.7) (2024-04-01)
### Features
* a11y-delegate-element-has-role-presentationでas, forwardedAsにform, fieldsetが指定されている場合、インタファクティブな要素として扱うように修正 ([#132](https://github.com/kufu/eslint-plugin-smarthr/issues/132)) ([3d629fa](https://github.com/kufu/eslint-plugin-smarthr/commit/3d629fa73e7346c229831a0075478fcbfe582de1))
* a11y-replace-unreadable-symbol ([#128](https://github.com/kufu/eslint-plugin-smarthr/issues/128)) ([9410ff9](https://github.com/kufu/eslint-plugin-smarthr/commit/9410ff9ad9ed5a0d18945e3567a1fee8c056f822))
### [0.5.6](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.5...v0.5.6) (2024-03-29)

@@ -7,0 +15,0 @@

2

package.json
{
"name": "eslint-plugin-smarthr",
"version": "0.5.6",
"version": "0.5.7",
"author": "SmartHR",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -14,2 +14,3 @@ # eslint-plugin-smarthr

- [a11y-prohibit-useless-sectioning-fragment](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-prohibit-useless-sectioning-fragment)
- [a11y-replace-unreadable-symbol](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-replace-unreadable-symbol)
- [a11y-trigger-has-button](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-trigger-has-button)

@@ -16,0 +17,0 @@ - [best-practice-for-button-element](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/best-practice-for-button-element)

@@ -46,2 +46,4 @@ const { generateTagFormatter } = require('../../libs/format_styled_components');

const INTERACTIVE_NODE_TYPE_REGEX = /^(JSXElement|JSXExpressionContainer|ConditionalExpression)$/
const AS_REGEX = /^(as|forwardedAs)$/
const AS_VALUE_REGEX = /^(form|fieldset)$/

@@ -126,2 +128,3 @@ const messageNonInteractiveEventHandler = (nodeName, interactiveComponentRegex, onAttrs) => {

let isRolePresentation = false
let isAsInteractive = false

@@ -133,2 +136,4 @@ node.attributes.forEach((a) => {

onAttrs.push(aName)
} else if (AS_REGEX.test(aName) && AS_VALUE_REGEX.test(a.value?.value || '')) {
isAsInteractive = true
} else if (aName === 'role') {

@@ -146,3 +151,3 @@ const v = a.value?.value || ''

if (nodeName.match(interactiveComponentRegex)) {
if (isAsInteractive || nodeName.match(interactiveComponentRegex)) {
if (isRolePresentation) {

@@ -149,0 +154,0 @@ context.report({

@@ -59,2 +59,4 @@ const rule = require('../rules/a11y-delegate-element-has-role-presentation');

{ code: '<Wrapper onClick={any} role="slider">Hoge</Wrapper>' },
{ code: '<Wrapper onSubmit={any} as="form" />' },
{ code: '<Wrapper onSubmit={any} forwardedAs="fieldset">any</Wrapper>' },
],

@@ -61,0 +63,0 @@ invalid: [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc