Skip to content

Commit bc963a2

Browse files
committed
Use replaceText instead of replaceTextRange
1 parent f818f12 commit bc963a2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rules/prefer-action-list-item-onselect.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ module.exports = {
5656
fix: fixer => {
5757
// Replace `onClick` with `onSelect`
5858
if (onClickAttribute.type === 'JSXAttribute') {
59-
return fixer.replaceTextRange(
60-
[onClickAttribute.name.range[0], onClickAttribute.name.range[1]],
61-
'onSelect',
62-
)
59+
return fixer.replaceText(onClickAttribute.name, 'onSelect')
6360
}
6461
return null
6562
},

0 commit comments

Comments
 (0)