1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import {DEFAULT_CONFIG_FILENAME, readConfigFile, resolveConfigs} from './cli';
|
12 | import {formatFiles, getFilesToFormat} from './format';
|
13 |
|
14 | export async function run() {
|
15 | const [defaultConfig, userConfig] = await Promise.all(
|
16 | [readConfigFile(DEFAULT_CONFIG_FILENAME), readConfigFile()]);
|
17 |
|
18 | const activeConfig = resolveConfigs(defaultConfig, userConfig);
|
19 | const filesToFormat = await getFilesToFormat(activeConfig);
|
20 | await formatFiles(filesToFormat, activeConfig.style);
|
21 | }
|