Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

30 changes: 27 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22, 24]
node: [20.19, 22, 24]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -36,14 +36,38 @@ jobs:
run: npm run typecheck

- name: Test
if: matrix.node != 18
run: npm run test:vitest

- name: Build
run: npm run build

- name: Upload Node 18 runtime artifact
if: matrix.node == 20.19
uses: actions/upload-artifact@v4
with:
name: node18-runtime-dist
path: dist
if-no-files-found: error

node18-runtime-smoke:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Download runtime artifact
uses: actions/download-artifact@v4
with:
name: node18-runtime-dist
path: dist

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 18

- name: Smoke runtime on Node 18
if: matrix.node == 18
run: |
node --input-type=module -e "await import('./dist/index.mjs'); console.log('esm-ok')"
node -e "require('./dist/index.cjs'); console.log('cjs-ok')"
36 changes: 36 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'eslint/config';
import tseslintPlugin from '@typescript-eslint/eslint-plugin';
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';

const tsconfigRootDir = path.dirname(fileURLToPath(import.meta.url));

export default defineConfig([
{
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
ignores: ['dist/**', 'lib/**', 'node_modules/**', 'coverage/**', '*.config.js'],
},
...tseslintPlugin.configs['flat/recommended-type-checked'],
prettierConfig,
{
files: ['{src,tests,examples}/**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir,
},
},
plugins: {
prettier: prettierPlugin,
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
},
},
]);
Loading
Loading