0

I am trying to modularise my Vuex store by writing below code

import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'

export const recoSideB = {
  namespaced: true,
  state = { ... } ,
  mutations= {... },
  actions= { ... },
  getters= { ... }
}

but getting Expression Expected.ts(1109) I have tried below config changes in eslint

parserOptions: {
    parser: 'babel-eslint',
    sourceType: 'module',
    ecmaVersion: 6,
    ecmaFeatures: {
      "experimentalObjectRestSpread": true
    }
  },

as per the answer by https://stackoverflow.com/a/36003974/7596740

but still facing the parsing issue

enter image description here

Ameya Salagre
  • 693
  • 9
  • 20

1 Answers1

0

Error occuried, because your object is incorrect.

Your object is:

export const recoSideB = {
  namespaced: true,
  state = { ... } ,
  mutations= {... },
  actions= { ... },
  getters= { ... }
}

But correct version must be:

export const recoSideB = {
  namespaced: true,
  state :{ ... } ,
  mutations:{... },
  actions:{ ... },
  getters:{ ... }
}
Ramil Aliyev
  • 3,414
  • 1
  • 22
  • 40