Skip to content

Commit fb4e21b

Browse files
authored
Merge pull request #232 from capralifecycle/cals-928/migrate-to-esm
cals 928/migrate to esm
2 parents f84752d + 56afa8a commit fb4e21b

25 files changed

+626
-98
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 20.18.1

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
all: build
33

44
.PHONY: build
5-
build:
5+
build: clean
66
npm install
77
./scripts/build-and-verify.sh
88
npm run lint
99
npm run prepare
1010
npm run test
11+
12+
.PHONY: clean
13+
clean:
14+
rm -rf lib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
extends: ["@commitlint/config-conventional"],
33
}

eslint.config.mjs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import path from "node:path";
2-
import { fileURLToPath } from "node:url";
3-
import js from "@eslint/js";
4-
import { FlatCompat } from "@eslint/eslintrc";
1+
import path from "node:path"
2+
import { fileURLToPath } from "node:url"
3+
import js from "@eslint/js"
4+
import { FlatCompat } from "@eslint/eslintrc"
55

6-
const __filename = fileURLToPath(import.meta.url);
7-
const __dirname = path.dirname(__filename);
6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = path.dirname(__filename)
88
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
recommendedConfig: js.configs.recommended,
11-
allConfig: js.configs.all
12-
});
9+
baseDirectory: __dirname,
10+
recommendedConfig: js.configs.recommended,
11+
allConfig: js.configs.all,
12+
})
1313

14-
export default [{
15-
ignores: ["coverage/", "lib/", "**/*.js", "**/*.mjs"],
16-
}, ...compat.extends(
14+
export default [
15+
{
16+
ignores: ["coverage/", "lib/", "**/*.js", "**/*.mjs", "scripts/**/*"],
17+
},
18+
...compat.extends(
1719
"plugin:@typescript-eslint/recommended",
1820
"plugin:@typescript-eslint/recommended-requiring-type-checking",
1921
"prettier",
2022
"plugin:prettier/recommended",
21-
), {
23+
),
24+
{
2225
files: ["**/*.ts"],
2326
languageOptions: {
2427
ecmaVersion: 5,
@@ -30,4 +33,5 @@ export default [{
3033
rules: {
3134
"@typescript-eslint/no-unused-vars": "warn",
3235
},
33-
}];
36+
},
37+
]

jest.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

jest.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
moduleNameMapper: {
3+
"^package.json$": "<rootDir>/package.json",
4+
5+
// workaround: jest doesn't work well with lodash-es,
6+
// so map to cjs lodash during test
7+
"^lodash-es$": "lodash"
8+
},
9+
preset: 'ts-jest',
10+
testEnvironment: "node",
11+
transform: {},
12+
}

0 commit comments

Comments
 (0)