eslint-plugin-dsm-ally
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "eslint-plugin-dsm-ally", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "plugin with custom rules for DSM a11y", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -42,3 +42,3 @@ 'use strict'; | ||
context.report({ | ||
node, | ||
node: node.parent, | ||
message: 'div/span with onClick must implement onKeyDown (or use getSelectionProps)' | ||
@@ -45,0 +45,0 @@ }); |
@@ -33,3 +33,5 @@ 'use strict'; | ||
} | ||
return null; | ||
if (att.argument && att.argument.callee) { | ||
return { name: att.argument.callee.name }; | ||
} | ||
}) | ||
@@ -39,3 +41,3 @@ .compact() | ||
if (!_.find(attributes, (att) => att.name === 'onClick')) { | ||
if (!_.find(attributes, (att) => att.name === 'onClick' || att.name === 'getSelectionProps')) { | ||
return; | ||
@@ -42,0 +44,0 @@ } |
@@ -32,3 +32,3 @@ 'use strict'; | ||
message: 'div/span with onClick must implement onKeyDown (or use getSelectionProps)', | ||
type: 'JSXOpeningElement' | ||
type: 'JSXElement' | ||
} | ||
@@ -42,3 +42,3 @@ ] | ||
message: 'div/span with onClick must implement onKeyDown (or use getSelectionProps)', | ||
type: 'JSXOpeningElement' | ||
type: 'JSXElement' | ||
} | ||
@@ -45,0 +45,0 @@ ] |
@@ -22,2 +22,11 @@ 'use strict'; | ||
{ | ||
code: '<div {...getSelectionProps(()=>{})} />', | ||
errors: [ | ||
{ | ||
message: 'div/span with onClick must be tab stoppable (tabIndex=0)', | ||
type: 'JSXElement' | ||
} | ||
] | ||
}, | ||
{ | ||
code: '<div onClick={()=>{}} />', | ||
@@ -24,0 +33,0 @@ errors: [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5506
182