kimroen / ember-cli-coffeescript

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
MIT License
72 stars 49 forks source link

Export classes directly instead of saving to variable #134

Closed kimroen closed 7 years ago

kimroen commented 7 years ago

This is the way exporting is done at the moment:

import Ember from 'ember'

ArticlesController = Ember.Controller.extend()

export default ArticlesController

This is because before CoffeeScript 1.12 when export and import were reserved words, we had to have those words on separate lines so we could surround them with backtics (which executes the code as JavaScript).

This isn't necessary anymore, so I think we should export directly to more closely resemble the built-in blueprints and learning material.

The above example would be like this:

import Ember from 'ember'

export default Ember.Controller.extend()