Skip to content

Commit ff32f05

Browse files
committed
Use es modules
1 parent f027055 commit ff32f05

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Diff for: jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
clearMocks: true,
33
collectCoverage: true,
44
collectCoverageFrom: [

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"description": "Sets up a problem matcher for markdownlint-cli to create annotations for violations",
66
"main": "dist/index.js",
7+
"type": "module",
78
"scripts": {
89
"build": "tsc",
910
"lint": "tsc --noEmit",

Diff for: src/main.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { readFile } from "node:fs/promises";
2-
import { join } from "node:path";
32

43
import { getInput, setFailed } from "@actions/core";
5-
import { issueCommand } from "@actions/core/lib/command"
4+
import { issueCommand } from "@actions/core/lib/command.js"
65

76
import type { ProblemMatcherDocument } from "github-actions-problem-matcher-typings";
87

98
export async function run(): Promise<void> {
109
try {
1110
const action = getInput("action");
1211

13-
const matcherFile = join(__dirname, "problem-matcher.json");
12+
const matcherFile = new URL("problem-matcher.json", import.meta.url);
1413

1514
switch (action) {
1615
case "add":

Diff for: tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"compilerOptions": {
33
/* Basic Options */
44
// "incremental": true, /* Enable incremental compilation */
5-
"target": "es2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
6-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
5+
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
6+
"module": "Node16", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
77
// "allowJs": true, /* Allow javascript files to be compiled. */
88
// "checkJs": true, /* Report errors in .js files. */
99
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
@@ -38,7 +38,7 @@
3838
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
3939

4040
/* Module Resolution Options */
41-
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
41+
"moduleResolution": "Node16", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
4242
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4343
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
4444
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */

0 commit comments

Comments
 (0)