diff --git a/lib/rules/no-side-effects-in-computed-properties.js b/lib/rules/no-side-effects-in-computed-properties.js index e6cd548e9..761b1ac61 100644 --- a/lib/rules/no-side-effects-in-computed-properties.js +++ b/lib/rules/no-side-effects-in-computed-properties.js @@ -31,15 +31,9 @@ module.exports = { create(context) { /** @type {Map} */ const computedPropertiesMap = new Map() - /** - * @typedef {object} ScopeStack - * @property {ScopeStack} upper - * @property {BlockStatement | Expression} body - */ - /** - * @type {ScopeStack} - */ - let scopeStack + + /** @type { { upper: any, body: null | BlockStatement | Expression } } */ + let scopeStack = { upper: null, body: null } /** @param {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} node */ function onFunctionEnter(node) { diff --git a/tests/lib/rules/no-side-effects-in-computed-properties.js b/tests/lib/rules/no-side-effects-in-computed-properties.js index b2f341a18..40caaf0c9 100644 --- a/tests/lib/rules/no-side-effects-in-computed-properties.js +++ b/tests/lib/rules/no-side-effects-in-computed-properties.js @@ -173,6 +173,13 @@ ruleTester.run('no-side-effects-in-computed-properties', rule, { } })`, parserOptions + }, + { + code: `const test = { el: '#app' } + Vue.component('test', { + el: test.el + })`, + parserOptions } ], invalid: [