How to use the @nrwl/workspace.formatFiles function in @nrwl/workspace

To help you get started, we’ve selected a few @nrwl/workspace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrwl / nx / packages / express / src / schematics / application / application.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    const options = normalizeOptions(schema);
    return chain([
      init({ skipFormat: true }),
      externalSchematic('@nrwl/node', 'application', schema),
      addMainFile(options),
      addTypes(options),
      formatFiles(options)
    ])(host, context);
  };
}
github nrwl / nx / packages / nest / src / schematics / application / application.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    const options = normalizeOptions(schema);
    return chain([
      init({
        skipFormat: true
      }),
      externalSchematic('@nrwl/node', 'application', schema),
      addMainFile(options),
      addAppFiles(options),
      updateJsonInTree(join(options.appProjectRoot, 'tsconfig.json'), json => {
        json.compilerOptions.emitDecoratorMetadata = true;
        return json;
      }),
      formatFiles(options)
    ])(host, context);
  };
}
github bennymeg / nx-electron / src / schematics / init / init.ts View on Github external
export default function(schema: Schema) {
  return chain([
    setDefault(),
    addPackageWithInit('@nrwl/jest'),
    addDependencies(),
    moveDependency(),
    formatFiles(schema)
  ]);
}
github nrwl / nx / packages / express / src / schematics / init / init.ts View on Github external
export default function(schema: Schema) {
  return chain([
    setDefault(),
    addPackageWithInit('@nrwl/node'),
    addPackageWithInit('@nrwl/jest'),
    addDependencies(),
    moveDependency(),
    formatFiles(schema)
  ]);
}
github nrwl / nx / packages / react / src / schematics / application / application.ts View on Github external
}),
      addLintFiles(options.appProjectRoot, options.linter, {
        localConfig: reactEslintJson,
        extraPackageDeps: extraEslintDependencies
      }),
      createApplicationFiles(options),
      updateNxJson(options),
      addProject(options),
      addCypress(options),
      addJest(options),
      updateJestConfig(options),
      addStyledModuleDependencies(options),
      addRouting(options, context),
      addBabel(options),
      setDefaults(options),
      formatFiles(options)
    ]);
  };
}
github nrwl / nx / packages / react / src / schematics / library / library.ts View on Github external
project: options.name,
            setupFile: 'none',
            supportTsx: true,
            skipSerializers: true
          })
        : noop(),
      externalSchematic('@nrwl/react', 'component', {
        name: options.name,
        project: options.name,
        style: options.style,
        skipTests: options.unitTestRunner === 'none',
        export: true,
        routing: options.routing
      }),
      updateAppRoutes(options, context),
      formatFiles(options)
    ])(host, context);
  };
}
github nrwl / nx / packages / angular / src / schematics / ngrx / ngrx.ts View on Github external
const moduleModification = !options.onlyAddFiles
      ? [
          addImportsToModule(requestContext),
          addExportsToBarrel(requestContext.options)
        ]
      : [];

    const packageJsonModification = !options.skipPackageJson
      ? [addNgRxToPackageJson()]
      : [];

    return chain([
      ...fileGeneration,
      ...moduleModification,
      ...packageJsonModification,
      formatFiles(options)
    ])(host, context);
  };
}
github nrwl / nx / packages / web / src / schematics / application / application.ts View on Github external
options.e2eTestRunner === 'cypress'
        ? externalSchematic('@nrwl/cypress', 'cypress-project', {
            ...options,
            name: options.name + '-e2e',
            directory: options.directory,
            project: options.projectName
          })
        : noop(),
      options.unitTestRunner === 'jest'
        ? externalSchematic('@nrwl/jest', 'jest-project', {
            project: options.projectName,
            skipSerializers: true,
            setupFile: 'web-components'
          })
        : noop(),
      formatFiles(options)
    ])(host, context);
  };
}
github nrwl / nx / packages / angular / src / schematics / upgrade-module / upgrade-module.ts View on Github external
export default function(options: Schema): Rule {
  const angularJsImport = options.angularJsImport
    ? options.angularJsImport
    : options.name;

  return chain([
    createFiles(angularJsImport, options),
    addImportsToModule(options),
    addNgDoBootstrapToModule(options),
    options.skipPackageJson ? noop() : addUpgradeToPackageJson(),
    formatFiles(options)
  ]);
}
github nrwl / nx / packages / node / src / schematics / library / library.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    const options = normalizeOptions(schema);

    return chain([
      externalSchematic('@nrwl/workspace', 'lib', schema),
      createFiles(options),
      updateTsConfig(options),
      addProject(options),
      formatFiles(options)
    ]);
  };
}