@cluesurf/form 0.6.20 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/host/make/flow.js +5 -7
- package/host/make/flow.js.map +1 -1
- package/package.json +1 -1
package/host/make/flow.js
CHANGED
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import os from 'os';
|
|
11
11
|
import pLimit from 'p-limit';
|
|
12
12
|
import prettier from 'prettier';
|
|
13
|
-
import { ESLint } from 'eslint';
|
|
14
13
|
import { Project } from 'ts-morph'; // npm i ts-morph
|
|
15
14
|
// 1. Create a single ts-morph project once (cheap to reuse)
|
|
16
15
|
const project = new Project({
|
|
@@ -47,18 +46,17 @@ export function washFileList(fileList) {
|
|
|
47
46
|
sourceFile.organizeImports();
|
|
48
47
|
}
|
|
49
48
|
// 5. Create ESLint instance
|
|
50
|
-
const eslint = new ESLint({ fix: true })
|
|
49
|
+
// const eslint = new ESLint({ fix: true })
|
|
51
50
|
// 6. Read back, ESLint + Prettier format in parallel (in-memory)
|
|
52
51
|
const taskList = fileList.map(({ file }) => limit(() => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
52
|
const sf = project.getSourceFileOrThrow(file);
|
|
55
53
|
const organized = sf.getFullText();
|
|
56
|
-
// Apply ESLint fixes for spacing
|
|
57
|
-
const eslintResults =
|
|
58
|
-
const eslintFixed =
|
|
54
|
+
// // Apply ESLint fixes for spacing
|
|
55
|
+
// const eslintResults = await eslint.lintText(organized, { filePath: file })
|
|
56
|
+
// const eslintFixed = eslintResults[0]?.output || organized
|
|
59
57
|
// Load prettier config from project
|
|
60
58
|
const prettierConfig = (yield prettier.resolveConfig(process.cwd())) || PRETTIER;
|
|
61
|
-
const formatted = yield prettier.format(
|
|
59
|
+
const formatted = yield prettier.format(organized, Object.assign(Object.assign({}, prettierConfig), { parser: 'typescript' }));
|
|
62
60
|
return {
|
|
63
61
|
file,
|
|
64
62
|
text: formatted,
|
package/host/make/flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../make/flow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,QAAQ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../make/flow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,QAAQ,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA,CAAC,iBAAiB;AAEpD,4DAA4D;AAC5D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;IAC1B,qBAAqB,EAAE,IAAI;IAC3B,8CAA8C;IAC9C,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;CACxD,CAAC,CAAA;AAEF,yDAAyD;AACzD,MAAM,QAAQ,GAAqB;IACjC,WAAW,EAAE,OAAO;IACpB,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,KAAK;IACX,sBAAsB,EAAE,IAAI;IAC5B,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,YAAY;CACrB,CAAA;AAED,MAAM,UAAgB,YAAY,CAChC,QAA+C;;QAE/C,mCAAmC;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC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