|
1 |
| -import stringArgv from "string-argv"; |
2 |
| -import fs from "fs"; |
3 |
| -import path from "path"; |
4 |
| -import YAML from "yaml"; |
5 |
| -import { promisify } from "util"; |
6 |
| -import { pathToFileURL } from "url"; |
7 |
| -import { IConfiguration } from "./types"; |
8 |
| -import { mergeConfigurations } from "./merge_configurations"; |
9 |
| -import ArgvParser from "./argv_parser"; |
10 |
| -import { checkSchema } from "./check_schema"; |
11 |
| -import { ILogger } from "../logger"; |
| 1 | +import stringArgv from 'string-argv' |
| 2 | +import fs from 'fs' |
| 3 | +import path from 'path' |
| 4 | +import YAML from 'yaml' |
| 5 | +import { promisify } from 'util' |
| 6 | +import { pathToFileURL } from 'url' |
| 7 | +import { IConfiguration } from './types' |
| 8 | +import { mergeConfigurations } from './merge_configurations' |
| 9 | +import ArgvParser from './argv_parser' |
| 10 | +import { checkSchema } from './check_schema' |
| 11 | +import { ILogger } from '../logger' |
12 | 12 |
|
13 | 13 | // eslint-disable-next-line @typescript-eslint/no-var-requires
|
14 | 14 | const { importer } = require('../importer')
|
@@ -51,11 +51,15 @@ async function loadFile(
|
51 | 51 | let definitions
|
52 | 52 | switch (extension) {
|
53 | 53 | case '.json':
|
54 |
| - definitions = JSON.parse(await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })) |
| 54 | + definitions = JSON.parse( |
| 55 | + await promisify(fs.readFile)(filePath, { encoding: 'utf-8' }) |
| 56 | + ) |
55 | 57 | break
|
56 | 58 | case '.yaml':
|
57 | 59 | case '.yml':
|
58 |
| - definitions = YAML.parse(await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })) |
| 60 | + definitions = YAML.parse( |
| 61 | + await promisify(fs.readFile)(filePath, { encoding: 'utf-8' }) |
| 62 | + ) |
59 | 63 | break
|
60 | 64 | default:
|
61 | 65 | try {
|
|
0 commit comments