GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: lint&fix auto generated types.ts · bulldba/lowcode-engine@7dde970

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • modules/material-parser/scripts
    • transform.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎modules/material-parser/scripts/transform.js‎

Copy file name to clipboardExpand all lines: modules/material-parser/scripts/transform.js
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ const fs = require('fs');
33
const path = require('path');
44
const Ajv = require('ajv');
55
const { compile } = require('json-schema-to-typescript');
6+
const { ESLint } = require('eslint');
67

78
const ajv = new Ajv();
9+
const eslint = new ESLint({ fix: true });
810

911
const YamlPath = path.resolve(__dirname, '../schemas/schema.yml');
1012
const JsonPath = path.resolve(__dirname, '../src/validate/schema.json');
@@ -19,9 +21,15 @@ const tsPath = path.resolve(__dirname, '../src/core/schema/types.ts');
1921
console.log('yaml file is successfully transformed into json');
2022
const ts = await compile(schema, 'ComponentMeta');
2123
fs.writeFileSync(tsPath, ts);
22-
console.log('schema.d.ts is successfully generated');
24+
// Lint files. This doesn't modify target files.
25+
const results = await eslint.lintFiles([tsPath]);
26+
27+
// Modify the files with the fixed code.
28+
await ESLint.outputFixes(results);
29+
30+
console.log('schema/types.d.ts is successfully generated');
2331
} catch (e) {
2432
console.log(e);
2533
process.exit(1);
2634
}
27-
})();
35+
})();

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.