How do write custom rule in javascript?

How do write a custom rule in javascript ?
i need step by step procedure .because i struggle that concept.

Hi,

This should help:

https://docs.sonarqube.org/display/PLUG/Custom+Rules+for+SonarJS

 
Ann