From 476a8c439cf24746d3d7adde7b6dc3caaffc820e Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Sun, 15 Dec 2024 11:42:42 +0100 Subject: [PATCH] - small cleanup --- jest.config.js | 7 ++++--- src/annotator.ts | 2 +- src/main.ts | 2 +- tsconfig.json | 33 ++++++++++++++++++++++++--------- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/jest.config.js b/jest.config.js index 16b0ee5d..2f16bb53 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,12 +1,13 @@ // jest.config.js import { createJsWithTsEsmPreset } from "ts-jest"; + export default { clearMocks: true, testEnvironment: "node", testMatch: ["**/*.test.ts"], testRunner: "jest-circus/runner", moduleNameMapper: { - "(.+)\\.js": "$1", + "(.+)\\.js": "$1" }, - ...createJsWithTsEsmPreset(), -} \ No newline at end of file + ...createJsWithTsEsmPreset() +}; \ No newline at end of file diff --git a/src/annotator.ts b/src/annotator.ts index 0ee9d125..ca048413 100644 --- a/src/annotator.ts +++ b/src/annotator.ts @@ -4,7 +4,7 @@ import * as github from '@actions/github' // eslint-disable-next-line import/extensions import {SummaryTableRow} from '@actions/core/lib/summary.js' // eslint-disable-next-line import/extensions -import {GitHub, context} from '@actions/github/lib/utils.js' +import {context, GitHub} from '@actions/github/lib/utils.js' import {buildTable} from './utils.js' export async function annotateTestResult( diff --git a/src/main.ts b/src/main.ts index d815fc3f..d40360c3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import * as core from '@actions/core' import * as github from '@actions/github' import {annotateTestResult, attachComment, attachSummary} from './annotator.js' -import {TestResult, parseTestReports} from './testParser.js' +import {parseTestReports, TestResult} from './testParser.js' import {buildTable, readTransformers, retrieve} from './utils.js' // eslint-disable-next-line import/extensions import {GitHub} from '@actions/github/lib/utils.js' diff --git a/tsconfig.json b/tsconfig.json index fc4ebf1f..eef622eb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,31 @@ { "compilerOptions": { - "target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "outDir": "./lib", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "target": "ESNext", + /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "NodeNext", + /* Redirect output structure to the directory. */ + "outDir": "./lib", + /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "rootDir": "./src", + /* Enable all strict type-checking options. */ + "strict": true, + /* Raise error on expressions and declarations with an implied 'any' type. */ + "noImplicitAny": true, "strictPropertyInitialization": true, "noImplicitThis": true, "moduleResolution": "Node16", - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - "lib": [ "ESNext","ES2021.String", "dom"] /* Enable custom `ES2021.String` extension in typescript for `replaceAll` */ + /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true, + /* Enable custom `ES2021.String` extension in typescript for `replaceAll` */ + "lib": [ + "ESNext", + "ES2021.String", + "dom" + ] }, - "exclude": ["node_modules", "__tests__/**.ts"], + "exclude": [ + "node_modules", + "__tests__/**.ts" + ] } \ No newline at end of file