5 defineConfigArrayFactoryWithInMemoryFileSystem
,
6 defineCascadingConfigArrayFactoryWithInMemoryFileSystem
,
7 defineFileEnumeratorWithInMemoryFileSystem
,
8 defineCLIEngineWithInMemoryFileSystem
,
9 defineESLintWithInMemoryFileSystem
10 } = require("./in-memory-fs");
14 * Prevents leading spaces in a multiline template literal from appearing in the resulting string
15 * @param {string[]} strings The strings in the template literal
16 * @param {any[]} values The interpolation values in the template literal.
17 * @returns {string} The template literal, with spaces removed from all lines
19 function unIndent(strings
, ...values
) {
21 .map((s
, i
) => (i
=== 0 ? s
: values
[i
- 1] + s
))
23 const lines
= text
.replace(/^\n/u, "").replace(/\n\s*$/u, "").split("\n");
24 const lineIndents
= lines
.filter(line
=> line
.trim()).map(line
=> line
.match(/ */u
)[0].length
);
25 const minLineIndent
= Math
.min(...lineIndents
);
27 return lines
.map(line
=> line
.slice(minLineIndent
)).join("\n");
34 defineConfigArrayFactoryWithInMemoryFileSystem
,
35 defineCascadingConfigArrayFactoryWithInMemoryFileSystem
,
36 defineFileEnumeratorWithInMemoryFileSystem
,
37 defineCLIEngineWithInMemoryFileSystem
,
38 defineESLintWithInMemoryFileSystem