import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';

export interface ScamOptions extends NgComponentOptions {
    separateModule: boolean;
}

export function scam(options: ScamOptions): Rule {

    let ruleList = [
        externalSchematic('@schematics/angular', 'module', options),
        externalSchematic('@schematics/angular', 'component', {
            ...options,
            export: true,
            module: options.name
        })
    ];

    if (!options.separateModule) {
        ruleList = [
            ...ruleList
        ];
    }

    return chain(ruleList);

}

import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';

export interface ScamOptions extends NgComponentOptions {
    separateModule: boolean;
}

export function scam(options: ScamOptions): Rule {

    const ruleList = [
        externalSchematic('@schematics/angular', 'module', options),
        externalSchematic('@schematics/angular', 'component', {
            ...options,
            export: true,
            module: options.name
        })
    ];

    return chain(ruleList);

}

--- 
+++ 
@@ -7,7 +7,7 @@
 
 export function scam(options: ScamOptions): Rule {
 
-    const ruleList = [
+    let ruleList = [
         externalSchematic('@schematics/angular', 'module', options),
         externalSchematic('@schematics/angular', 'component', {
             ...options,
@@ -16,6 +16,12 @@
         })
     ];
 
+    if (!options.separateModule) {
+        ruleList = [
+            ...ruleList
+        ];
+    }
+
     return chain(ruleList);
 
 }
@wishtack/schematics:scam: Merge module and component as default behavior.
