I am trying to create multiple plus-minus buttons for my application using VueJS. I have used halfpastfour.am sample code from this link jQuery multiple plus/minus Counter as sample code for my project.
$('.counter-btn').click(function(e) {
e.preventDefault();
var $btn = $(this);
$('#output-' + $btn.data('index')).html(function(i, val) {
val = val * 1 + $btn.data('inc');
return (val <= 0 ? '' : '+') + val;
});
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Above is the portion of the code which states there is parsing error: unexpected token under the $('.counter-btn')
Shown like this:
Module Error (from ./node_modules/eslint-loader/index.js):
error: Parsing error: Unexpected token
I tried to resolve by referring to this post ESLint Parsing error: Unexpected token. However I am unable to find any .eslintrc file in my project. Besides that, I appreciate if you can enlighten on why does these parsing errors tend to appear often. Thanks once again.