From c8e9e9cb6f52a7c59cfeb66adfe7ea0889e7731a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Wed, 12 Jun 2024 19:19:01 +0300 Subject: [PATCH] test: fix smoke tests (#474) * fix: `require` in ESM * chore: set `packageManager` * test: fix smoke tests --- .github/workflows/ci.yml | 1 - .github/workflows/smoke-test.yml | 13 +++++++------ eslint-remote-tester.config.ts | 22 ++++++++++++++++++---- package.json | 3 ++- pnpm-lock.yaml | 11 ++++++----- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42c252b..a01a162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: - uses: pnpm/action-setup@v3 with: - version: 8 run_install: false - name: Get pnpm store directory diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index f8e3a50..bc39b0d 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -9,23 +9,24 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 with: - version: 7.16.1 + run_install: false - uses: actions/setup-node@v3 with: node-version: 18.x cache: pnpm - - name: Install, Build & Link plugin + - name: Install, Build run: | pnpm install pnpm build - pnpm link . - pnpm link eslint-plugin-vitest + + - name: Update ESLint to v9 + run: pnpm i -D eslint@9 - uses: AriPerkkio/eslint-remote-tester-run-action@v5 with: diff --git a/eslint-remote-tester.config.ts b/eslint-remote-tester.config.ts index 88961cd..b2f7185 100644 --- a/eslint-remote-tester.config.ts +++ b/eslint-remote-tester.config.ts @@ -1,10 +1,24 @@ -import vitest from "eslint-plugin-vitest" +import parser from '@typescript-eslint/parser'; +import type { Config } from 'eslint-remote-tester'; +import { + getPathIgnorePattern, + getRepositories, +} from 'eslint-remote-tester-repositories'; +import vitest from './dist/index.mjs'; export default { - repositories: ['AriPerkkio/eslint-remote-tester-integration-test-target'], + repositories: getRepositories(), + pathIgnorePattern: getPathIgnorePattern(), extensions: ['ts', 'tsx', 'cts', 'mts'], concurrentTasks: 3, cache: false, logLevel: 'info', - eslintConfig: [vitest.configs.all] -} + eslintConfig: [ + vitest.configs.all, + { + languageOptions: { + parser, + }, + }, + ] as Config['eslintConfig'], +} satisfies Config; diff --git a/package.json b/package.json index 10cdb99..db3248d 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "files": [ "dist" ], + "packageManager": "pnpm@9.3.0", "scripts": { "build": "unbuild", "lint:eslint-docs": "pnpm build && eslint-doc-generator --check", @@ -56,7 +57,7 @@ "eslint-plugin-eslint-plugin": "^6.1.0", "eslint-plugin-vitest": "^0.5.4", "eslint-remote-tester": "^4.0.0", - "eslint-remote-tester-repositories": "^1.0.1", + "eslint-remote-tester-repositories": "^2.0.0", "importx": "^0.3.5", "tsx": "^4.10.5", "typescript": "^5.4.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acd53ff..c175a3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: specifier: ^4.0.0 version: 4.0.0(eslint@8.57.0)(importx@0.3.5)(jiti@1.21.0) eslint-remote-tester-repositories: - specifier: ^1.0.1 - version: 1.0.1 + specifier: ^2.0.0 + version: 2.0.0 importx: specifier: ^0.3.5 version: 0.3.5 @@ -1592,8 +1592,9 @@ packages: vitest: optional: true - eslint-remote-tester-repositories@1.0.1: - resolution: {integrity: sha512-XL9PqGBDL4rORnQ74b/3tqbJUpMlPz9gzKSrmYFtakLBQ/ayBELB/HZvd6ZEl+mH0vBeSYtUH7E/rawBsf9Qzg==} + eslint-remote-tester-repositories@2.0.0: + resolution: {integrity: sha512-BRMINT2nB6A7IJ08Kz4p7By9/Ru8D6yl4LAfjkDpFuKoX6Y25QEUyhgo8THh1GiTKWDP+RsYsGh2etmAP/v+lg==} + engines: {node: ^18.0.0 || >=20.0.0} eslint-remote-tester@4.0.0: resolution: {integrity: sha512-Lmb0I9tYMQNtNHN8tYTzk755PeDa/wToBJ1x8QuSBHdFl8+X4BcRRJMLlEdsyOe4urxbm/NeUKYo/Nw6gJxMgw==} @@ -5054,7 +5055,7 @@ snapshots: - supports-color - typescript - eslint-remote-tester-repositories@1.0.1: {} + eslint-remote-tester-repositories@2.0.0: {} eslint-remote-tester@4.0.0(eslint@8.57.0)(importx@0.3.5)(jiti@1.21.0): dependencies: