Custom rules are not supported by the analyzer. As an alternative we suggest you to have a look at ESLint, it provides custom rules that you can then import thanks to the External Issues feature.
Alternatively, you can build whatever tool you like and as long as you end up with a report in the generic issue format, pass this to the scanner and have the issues displayed.