Skip to content

Commit 2be1b9e

Browse files
authored
feat: use Jest 30, drop old versions of Node (#358)
1 parent 6b4b567 commit 2be1b9e

File tree

17 files changed

+3637
-4969
lines changed

17 files changed

+3637
-4969
lines changed

.eslintignore

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

.eslintrc.json

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

.github/workflows/nodejs.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,29 @@ on:
44
push:
55
branches:
66
- main
7+
- next
78
pull_request:
89
branches:
910
- '**'
11+
merge_group:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read # to fetch code (actions/checkout)
1019

1120
jobs:
1221
lint-and-typecheck:
1322
name: ESLint
1423
runs-on: ubuntu-latest
1524

1625
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-node@v4
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
1928
with:
20-
node-version: 'lts/*'
29+
node-version: lts/*
2130
cache: yarn
2231
- name: install
2332
run: yarn
@@ -34,13 +43,15 @@ jobs:
3443
strategy:
3544
fail-fast: false
3645
matrix:
37-
node-version: [14.x, 16.x, 18.x, 19.x, 20.x]
46+
node-version: [18.x, 20.x, 22.x, 24.x]
3847
runs-on: ubuntu-latest
3948

4049
steps:
41-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
51+
with:
52+
persist-credentials: false
4253
- name: Use Node.js ${{ matrix.node-version }}
43-
uses: actions/setup-node@v4
54+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
4455
with:
4556
node-version: ${{ matrix.node-version }}
4657
cache: yarn
@@ -57,14 +68,16 @@ jobs:
5768
strategy:
5869
fail-fast: false
5970
matrix:
60-
os: [ubuntu-latest, windows-latest, macOS-latest]
71+
os: [windows-latest, macOS-latest]
6172
runs-on: ${{ matrix.os }}
6273

6374
steps:
64-
- uses: actions/checkout@v4
65-
- uses: actions/setup-node@v4
75+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
76+
with:
77+
persist-credentials: false
78+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
6679
with:
67-
node-version: 'lts/*'
80+
node-version: lts/*
6881
cache: yarn
6982
- name: install
7083
run: yarn

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ projects
33
yarn-error.log
44
build
55
coverage
6+
.eslintcache
67

78
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
89
.yarn/*

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

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

.yarn/releases/yarn-3.8.7.cjs

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

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@ enableGlobalCache: true
22

33
nodeLinker: node-modules
44

5-
plugins:
6-
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7-
spec: "@yarnpkg/plugin-interactive-tools"
8-
9-
yarnPath: .yarn/releases/yarn-3.8.7.cjs
5+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

babel.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
2-
31
const semver = require('semver');
42
const pkg = require('./package.json');
53

eslint.config.mjs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { globalIgnores } from 'eslint/config';
2+
import jest from 'eslint-plugin-jest';
3+
import { importX } from 'eslint-plugin-import-x';
4+
import globals from 'globals';
5+
import eslint from '@eslint/js';
6+
import tseslint from 'typescript-eslint';
7+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
8+
9+
export default tseslint.config(
10+
globalIgnores(['**/build/']),
11+
eslint.configs.recommended,
12+
// eslint-disable-next-line import-x/no-named-as-default-member
13+
tseslint.configs.recommended,
14+
importX.flatConfigs.recommended,
15+
importX.flatConfigs.typescript,
16+
eslintPluginPrettierRecommended,
17+
{
18+
languageOptions: {
19+
globals: {
20+
...globals.node,
21+
...jest.environments.globals.globals,
22+
},
23+
},
24+
rules: {
25+
'import-x/no-extraneous-dependencies': [
26+
'error',
27+
{
28+
devDependencies: [
29+
'**/__tests__/**/*',
30+
'eslint.config.mjs',
31+
'babel.config.js',
32+
],
33+
},
34+
],
35+
'@typescript-eslint/no-import-type-side-effects': 'error',
36+
'@typescript-eslint/consistent-type-imports': [
37+
'error',
38+
{
39+
disallowTypeAnnotations: false,
40+
fixStyle: 'inline-type-imports',
41+
},
42+
],
43+
'@typescript-eslint/prefer-ts-expect-error': 'error',
44+
},
45+
},
46+
{
47+
files: ['integrationTests/__fixtures__/**/*'],
48+
49+
rules: {
50+
'no-console': 'off',
51+
},
52+
},
53+
{
54+
files: ['**/*.js'],
55+
56+
rules: {
57+
'@typescript-eslint/no-var-requires': 'off',
58+
'@typescript-eslint/no-require-imports': 'off',
59+
'@typescript-eslint/explicit-module-boundary-types': 'off',
60+
},
61+
},
62+
);

0 commit comments

Comments
 (0)