```coffeescript
{$} = require 'atom'

module.exports =
  configDefaults:
    enabled: false

  activate: (state) ->
    @migrateOldAutosaveConfig()

    atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
      editor = event.targetView()?.getModel()
      @autosave(editor)

    atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) =>
      @autosave(paneItem)

    $(window).preempt 'beforeunload', =>
      for pane in atom.workspaceView.getPanes()
        @autosave(paneItem) for paneItem in pane.getItems()

  autosave: (paneItem) ->
    if atom.config.get('autosave.enabled') and paneItem?.getUri?()?
      paneItem?.save?()

  migrateOldAutosaveConfig: ->
    enabled = atom.config.get('core.autosave')
    return unless enabled?

    atom.config.set('autosave.enabled', enabled)
    atom.config.set('core.autosave', null)
```

Remove migration of old config setting
user
```coffeescript
{$} = require 'atom'

module.exports =
  configDefaults:
    enabled: false

  activate: ->
    atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
      editor = event.targetView()?.getModel()
      @autosave(editor)

    atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) =>
      @autosave(paneItem)

    $(window).preempt 'beforeunload', =>
      for pane in atom.workspaceView.getPanes()
        @autosave(paneItem) for paneItem in pane.getItems()

  autosave: (paneItem) ->
    if atom.config.get('autosave.enabled') and paneItem?.getUri?()?
      paneItem?.save?()
```
assistant