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 do? Please include the actual source code causing the issue.
First of all, I'm not sure if this is a problem with eslint-plugin-vue or with vscode-eslint extension.
I have some Vue components where I map Vuex getters&actions to computed properties, like this example:
However, vscode-eslint throws several exceptions when I write computed properties based on such mappings.
What did you expect to happen?
I expect that vscode-eslint can lint my code successfully
What actually happened? Please include the actual, raw output from ESLint.
I've got the following exception from vscode-eslint:
[Error - 10:56:24] ESLint stack trace:
[Error - 10:56:24] TypeError: Cannot read property 'type' of undefined
at cp.value.properties.filter.p (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint-plugin-vue/lib/utils/index.js:347:20)
at Array.filter (native)
at computedPropertiesNode.value.properties.filter.map.cp (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint-plugin-vue/lib/utils/index.js:346:14)
at Array.map (native)
at Object.getComputedProperties (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint-plugin-vue/lib/utils/index.js:338:8)
at Object.assign.utils.executeOnVue (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint-plugin-vue/lib/rules/no-async-in-computed-properties.js:118:40)
at ExportDefaultDeclaration:exit (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint-plugin-vue/lib/utils/index.js:467:9)
at listeners.(anonymous function).forEach.listener (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (native)
at Object.emit (/home/laercio/Documentos/GitLab/pte-mogidascruzes/mae-electron-quasar/node_modules/eslint/lib/util/safe-emitter.js:47:38)
Possible workaround
With this workaround, vscode-eslint stops throwing the exceptions above and lints my code successfully.
Interesting pattern :D I didn't thought of this case before and we're probably missing one additional check to prevent this error from happening. Thanks for posting this issue @lbssousa :)
Tell us about your environment
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
First of all, I'm not sure if this is a problem with eslint-plugin-vue or with vscode-eslint extension.
I have some Vue components where I map Vuex getters&actions to computed properties, like this example:
However, vscode-eslint throws several exceptions when I write computed properties based on such mappings.
What did you expect to happen?
I expect that vscode-eslint can lint my code successfully
What actually happened? Please include the actual, raw output from ESLint.
I've got the following exception from vscode-eslint:
Possible workaround
With this workaround, vscode-eslint stops throwing the exceptions above and lints my code successfully.
The text was updated successfully, but these errors were encountered: