To use Ansible's built-in syntax checker, you can use --syntax-check option:
ansible-playbook playbook.yml --syntax-check