From b6fb95258089267fe687e184f7dbb39104012eef Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 5 Oct 2022 18:31:53 +0200 Subject: [PATCH] Switch CommonJS configuration to module instead. --- package.json | 16 +++++++++------- tsconfig.json | 7 +------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index da9dd38..b6f1c93 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "license": "AGPL-3.0-or-later", "repository": "https://git.bauke.xyz/Holllo/re-nav", "private": true, + "type": "module", "scripts": { "start": "vite build -m development --watch", "start:chromium": "VITE_BROWSER=chromium pnpm start", @@ -11,7 +12,8 @@ "build:chromium": "VITE_BROWSER=chromium vite build && web-ext build -n re-nav-chromium-{version}.zip -s build/chromium", "build:firefox": "VITE_BROWSER=firefox vite build && web-ext build -n re-nav-firefox-{version}.zip -s build/firefox", "zip-source": "git archive --format zip --output web-ext-artifacts/re-nav-source.zip HEAD", - "test": "xo && stylelint 'source/**/*.scss' && tsc && c8 ava" + "test": "xo && stylelint 'source/**/*.scss' && tsc && c8 ava", + "test:snapshots": "c8 ava --update-snapshots" }, "dependencies": { "@holllo/migration-helper": "^0.1.3", @@ -40,14 +42,15 @@ "xo": "^0.52.3" }, "ava": { - "extensions": [ - "ts" - ], + "extensions": { + "ts": "module" + }, "files": [ "tests/**/*.test.ts" ], - "require": [ - "ts-node/register" + "nodeArguments": [ + "--loader=ts-node/esm", + "--no-warnings" ], "snapshotDir": "tests/snapshots" }, @@ -68,7 +71,6 @@ "files": "tests/**/*.test.ts", "rules": { "@typescript-eslint/triple-slash-reference": "off", - "import/extensions": "off", "no-await-in-loop": "off" } } diff --git a/tsconfig.json b/tsconfig.json index 48115cf..938079e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,10 +15,5 @@ "source/**/*.ts", "tests/**/*.ts", "vite.config.ts" - ], - "ts-node": { - "compilerOptions": { - "module": "CommonJS" - } - } + ] }