Skip to content

Commit 1a9a97e

Browse files
authored
chore(ts-interface-generator): update more dependencies (#527)
In particular new eslint config format Plus adapt formatting
1 parent bb005ee commit 1a9a97e

File tree

10 files changed

+280
-403
lines changed

10 files changed

+280
-403
lines changed

packages/ts-interface-generator/.eslintrc.js

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
const { defineConfig, globalIgnores } = require("eslint/config");
2+
3+
const globals = require("globals");
4+
const tsParser = require("@typescript-eslint/parser");
5+
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
6+
const js = require("@eslint/js");
7+
8+
const { FlatCompat } = require("@eslint/eslintrc");
9+
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
});
15+
16+
module.exports = defineConfig([
17+
{
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
...globals.node,
22+
},
23+
24+
parser: tsParser,
25+
sourceType: "module",
26+
27+
parserOptions: {
28+
project: [
29+
"./tsconfig.json",
30+
"./tsconfig-testcontrol.json",
31+
"./tsconfig-tests.json",
32+
],
33+
tsconfigRootDir: __dirname,
34+
},
35+
},
36+
37+
extends: compat.extends(
38+
"eslint:recommended",
39+
"plugin:@typescript-eslint/recommended",
40+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
41+
),
42+
43+
plugins: {
44+
"@typescript-eslint": typescriptEslint,
45+
},
46+
47+
rules: {
48+
"@typescript-eslint/ban-ts-comment": [
49+
"error",
50+
{
51+
"ts-ignore": "allow-with-description",
52+
minimumDescriptionLength: 10,
53+
},
54+
],
55+
},
56+
},
57+
globalIgnores([
58+
"**/.eslintrc.js",
59+
"**/someFile.js",
60+
"**/*.gen.d.ts",
61+
"src/test/samples/sampleWebComponent/**/*",
62+
]),
63+
]);

packages/ts-interface-generator/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"@types/node": "24.7.2",
4141
"@types/openui5": "1.127.0",
4242
"@types/yargs": "17.0.33",
43-
"@typescript-eslint/eslint-plugin": "7.14.1",
44-
"@typescript-eslint/parser": "7.14.1",
45-
"eslint": "8.57.0",
43+
"@typescript-eslint/eslint-plugin": "8.46.1",
44+
"@typescript-eslint/parser": "8.46.1",
45+
"eslint": "9.37.0",
4646
"jest": "30.2.0",
4747
"npm-run-all": "4.1.5",
4848
"ts-jest": "29.4.5",
@@ -51,7 +51,7 @@
5151
"dependencies": {
5252
"hjson": "3.2.2",
5353
"loglevel": "1.9.2",
54-
"yargs": "17.7.2"
54+
"yargs": "18.0.0"
5555
},
5656
"peerDependencies": {
5757
"typescript": ">=5.2.0"

packages/ts-interface-generator/src/addSourceExports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import path = require("path");
2-
import ts = require("typescript");
1+
import path from "path";
2+
import ts from "typescript";
33

44
/**
55
* This function aims to find the UI5-style global name for all exports of the given source file

packages/ts-interface-generator/src/astGenerationHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ts = require("typescript");
1+
import ts from "typescript";
22
import astToString from "./astToString";
33
import log from "loglevel";
44
import {

packages/ts-interface-generator/src/generateTSInterfaces.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import yargs from "yargs";
88

99
// configure yargs with the cli options as launcher
1010
const version = `${pkgJson.version} (from ${__filename})`;
11-
yargs.version(version);
12-
yargs
11+
const appArgs = yargs()
12+
.version(version)
1313
.option({
1414
config: {
1515
alias: "c",
@@ -33,7 +33,6 @@ yargs
3333
},
3434
})
3535
.default("watch", false)
36-
.default("loglevel", "info");
36+
.default("loglevel", "info").argv as Args;
3737

38-
const appArgs = yargs.argv as Args;
3938
main(appArgs);

0 commit comments

Comments
 (0)