Created
December 3, 2016 05:31
-
-
Save olsonpm/c71d8cad6a0a219cea11e84aed8723db to your computer and use it in GitHub Desktop.
generator-option-type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Base = require('yeoman-generator'); | |
module.exports = Base.extend({ | |
constructor() { | |
Base.apply(this, arguments); | |
this.option('aBoolOpt', { | |
type: Boolean | |
}); | |
} | |
, initializing: { | |
doIt: function doIt() { | |
console.log('typeof aBoolOpt: ' + (typeof this.options.aBoolOpt)); | |
} | |
} | |
}); |
I've got the same issue, turns out that we cannot use both ES6's object method shorthand
and arrow functions
as a constructor. 😞
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ yo option-type
results in