for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
define(['jquery', 'routing'], ($, Routing) => {
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.
Further Reading:
return {
attach(element, input) {
let $el = $(element),
$input = $(input);
$input.on('change', () => {
if ('' === $input.val()) {
$input
.closest('.form-group')
.removeClass('has-success has-error')
Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.
Further Readings:
}
});
$el.on('click', (e) => {
e.preventDefault();
let original = $el.html();
$el.html('<i class="fa fa-spin fa-refresh"></i>');
$.ajax({
'url' : Routing.generate('_tax_number_validate'),
'data': {'vat_number': $input.val()},
'method': 'POST'
}).done((result) => {
.addClass(result.valid ? 'has-success' : 'has-error');
}).always(() => {
$el.html(original);
};
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.
Further Reading: