[Vuejs]-Unexpected block statement surrounding arrow body sort method

0👍

If a fat arrow function just consists of a return statement, you don’t need to wrap it in braces, just put the expression being returned:

getters: {
    loadedMeetups(state) {
        return state.loadedMeetups.sort((meetupA, meetupB) => meetupA.date > meetupB.date);
},

JSLint is simply warning that you have this redundant code.

Leave a comment