profile
viewpoint

Ask questionsTrailing comma, spacing, and incorrect parentheses causes build issues in an application

<!-- IMPORTANT: If you do not provide a reproducible example (ie. via codepen.io), we likely won't be able to help you to the best of our abilities, and could automatically close this issue. -->

Current behavior

<Please describe here what faulty behavior you are experiencing> Trailing comma causes build issues

Expected behavior

No Trailing comma should exist in math.max

Steps to reproduce the problem

This code block in the AutoNumeric.js file has a trailing comma after the last additionalDecimalPlacesRawValue variable as bolded below settings.decimalPlacesRawValue = Math.max(Math.max(settings.decimalPlacesShownOnBlur, settings.decimalPlacesShownOnFocus) +additionalDecimalPlacesRawValue, Number(settings.originalDecimalPlacesRawValue) + additionalDecimalPlacesRawValue, );

autoNumeric/autoNumeric

Answer questions AlexandreBonneau

Trailing commas are valid in function parameters since ECMAScript 2017. The autoNumeric eslint configuration uses the comma-dangle option accordingly.

If your build is failing, it means your build process does not correctly manage ECMAScript.

All in all, trailing commas, spacing and parentheses are always checked by eslint on build (and during edition via my IDE), so an error there is highly unlikely. I would suggest you give eslint a try (with that configuration file; it helps quite a lot.

useful!

Related questions

Destroy multiple autonumeric hot 1
The selector did not select any valid DOM element. Please check on which element you called AutoNumeric. hot 1
On initialization, `allowDecimalPadding` option `'floats'` does not hide the decimal zeroes if set in the html attribute hot 1
Need option to indicate seed value is already localized hot 1
ajax double initialize hot 1
The value [] being set falls outside of the minimumValue [] and maximumValue [] range set for this element hot 1
`digitGroupSeparator` do not recognize the `'&#xA0;'` string hot 1
The value [] being set falls outside of the minimumValue [] and maximumValue [] range set for this element hot 1
Admit locales (es-ES, en-GB, etc.) to format the numbers hot 1
Setting `unformatOnSubmit` to `true` does not unformat the element on the form' `submit` event hot 1
Input value will undo on focusout when using only Ctrl+Backspace hot 1
'formulaMode: true' - not working hot 1
source:https://uonfu.com/
Github User Rank List