You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you expect to happen? vue/prefer-use-template-ref should not crash.
What actually happened?
TypeError: Cannot read properties of undefined (reading 'filter')
Occurred while linting foo.ts:220
Rule: "vue/prefer-use-template-ref"
at getScriptRefsFromSetupFunction (…/node_modules/eslint-plugin-vue/lib/rules/prefer-use-template-ref.js:33:37)
at Object.onSetupFunctionEnter (…/node_modules/eslint-plugin-vue/lib/rules/prefer-use-template-ref.js:82:33)
at callVisitor (…/node_modules/eslint-plugin-vue/lib/utils/index.js:1246:21)
at vueVisitor.Property[value.type=/^(Arrow)?FunctionExpression$/] > :function (…/node_modules/eslint-plugin-vue/lib/utils/index.js:1314:13)
at ruleErrorHandler (…/node_modules/eslint/lib/linter/linter.js:1076:28)
at …/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (…/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (…/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (…/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
The text was updated successfully, but these errors were encountered:
FloEdelmann
changed the title
vue/prefer-use-template-ref crashes when setup is an arrow functionvue/prefer-use-template-ref crashes for setup arrow function
Dec 3, 2024
ntnyq
linked a pull request
Dec 3, 2024
that will
close
this issue
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
vue/prefer-use-template-ref
should not crash.What actually happened?
Repository to reproduce this issue
https://ota-meshi.github.io/eslint-plugin-vue-demo/#eJwtyzEKhDAQRuGrhKkSMAhbBrXxGmkW/QVBJ0My2Sbk7lrsKz94jba0gwJNZcun6BJ5x3Ey1nRLYrDaFtm8FWiVYKwz82Js626I3F3kafyfNFCuFwqFRr+KUTIOZF8LvOKW66vwL1H49P4AdL8oqw==
Additional information
This was not a problem in v9.31.0, so it was probably introduced in #2608 or #2612. CC @ntnyq @Thomasan1999
The text was updated successfully, but these errors were encountered: