This file contains 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
import { Rule, Tree } from '@angular-devkit/schematics'; | |
import * as prettier from 'prettier'; | |
import { Observable } from 'rxjs'; | |
export default function(): Rule { | |
return (tree: Tree) => | |
new Observable<Tree>(o => { | |
prettier.resolveConfig(process.cwd()).then(prettierConfig => { | |
if (!prettierConfig) { | |
o.error(new Error('Could not resolve prettier configuration')); |