requireSpacesInGenerator

Requires space before and after * in generator functions

Types: Object

  • Object (at least one of properties must be present and it must be set to true):
    • 'beforeStar'
      • true validates that there is a space before *
    • 'afterStar'
      • true validates that there is a space after *

Example

"requireSpacesInGenerator": {
    "beforeStar": true,
    "afterStar": true
}
Valid for mode { "beforeStar": true, "afterStar": true }
var x = function * () {};
function * a() {};
var x = async function * () {};
var x = async function * a () {};
async function * a() {}
var x = async function * (){};
Rule source
Test source