I think this is too broad. It would also match:

```js
var foo = "hello ; there"
```

Maybe changing to `/\s;$/` would help? I'd add a test for the string use case.