```coffeescript
module.exports =
  activate: (rootView) ->
    for buffer in rootView.project.getBuffers()
      @stripTrailingWhitespaceBeforeSave(buffer)

    rootView.project.on 'new-buffer', (buffer) =>
      @stripTrailingWhitespaceBeforeSave(buffer)

  stripTrailingWhitespaceBeforeSave: (buffer) ->
    buffer.on 'before-save', ->
      buffer.scan /[ \t]+$/g, (match, range, { replace }) ->
        replace('')
```

Make strip whitespace a valid extension
user
```coffeescript
module.exports =
  name: "strip trailing whitespace"

  activate: (rootView) ->
    for buffer in rootView.project.getBuffers()
      @stripTrailingWhitespaceBeforeSave(buffer)

    rootView.project.on 'new-buffer', (buffer) =>
      @stripTrailingWhitespaceBeforeSave(buffer)

  stripTrailingWhitespaceBeforeSave: (buffer) ->
    buffer.on 'before-save', ->
      buffer.scan /[ \t]+$/g, (match, range, { replace }) ->
        replace('')
```
assistant