How to get rid of this key word in vue app to make it JSLint

In below component for closeModal method how can I get rid of this keyword? JSLint is complaining about it “Unexpected this”.

/*jslint es6*/
/*property
    $emit, closeModal, created, data, formSetting, methods, name, props,
    start, modalevent, closeWeatherForm, toUpperCase, autoCompletePlaceholder
*/
import EventConst from "@/constants/event.constant.js";
import EventBus from "@/bus.js";

export default {
    name: "weatherForm",
    props: ["start"],
    data() {
        return {
            formSetting: {}
        };
    },
    methods: {
        closeModal: function (isSave) {
            var vm = this;
            if (isSave) {
                vm.formSetting.start = vm.start.toUpperCase();
                EventBus.$emit(EventConst.modalevent.closeWeatherForm, vm.formSetting);
            } else {
                EventBus.$emit(EventConst.modalevent.closeWeatherForm, false);
            }
        }
    }
};

Since using this is totally normal here, you should rather try to fix jslint or disable it here.

Since I use eslint I won’t be able to help you with any details concerning eslint

The solution is simple, switch to eslint, it has a great configuration and documentation.

As far as I remember from notepad++ days, jshint had no intelisense, didn’t even look outside current file and those constant warnings that something is not defined even it’s defined globally. Haven’t used it for years, maybe it has progressed since then :slight_smile:.

I really like JSLint as it is a lot stricter and help writing better code.

Have you ever used eslint?