disallowSpacesInGenerator

Disallow space before or after * in generator functions

Types: Object

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

Example

"disallowSpacesInGenerator": {
    "beforeStar": true,
    "afterStar": true
}
Valid for mode { "beforeStar": true, "afterStar": false }
var x = function* () {};
function* a() {};
var x = async function* () {};
var x = async function* a () {};
async function* a() {}
var x = async function* (){};
Valid for mode { "beforeStar": false, "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