[Components]: improve JS codes according to JSHint