Skip to content

Commit 5071a4a

Browse files
authored
feat!: Require Node >= 20.18 (#341)
1 parent 5c75e27 commit 5071a4a

File tree

14 files changed

+2885
-3796
lines changed

14 files changed

+2885
-3796
lines changed

.eslintrc.cjs

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

.github/actions/setup/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
node-version:
55
required: false
66
description: The version of Node to use.
7-
default: '18.x'
7+
default: '20.x'
88
runs:
99
using: 'composite'
1010
steps:

.github/workflows/test.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,13 @@ jobs:
2727
strategy:
2828
matrix:
2929
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
30-
node-version: [18.x, 20.x, 22.x]
30+
node-version: [20.x, 22.x, 24.x]
3131
os:
3232
- ubuntu-latest
3333

34-
steps:
35-
- uses: actions/checkout@v4
36-
- name: Setup
37-
uses: ./.github/actions/install-build-test
38-
with:
39-
node-version: ${{ matrix.node-version }}
40-
41-
test-os:
42-
runs-on: ${{ matrix.os }}
43-
44-
strategy:
45-
matrix:
46-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
47-
node-version: [18.x]
48-
os:
49-
- windows-latest
34+
include:
35+
- os: windows-latest
36+
node-version: 24.x
5037

5138
steps:
5239
- uses: actions/checkout@v4

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ words:
1414
- bitjson
1515
- caddyserver
1616
- coverallsapp
17+
- esbuild
1718
- exonum
1819
- gitbucket
1920
- histo

eslint.config.mjs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import nodePlugin from 'eslint-plugin-n';
5+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
6+
import tsEslint from 'typescript-eslint';
7+
8+
export default tsEslint.config(
9+
eslint.configs.recommended,
10+
nodePlugin.configs['flat/recommended'],
11+
...tsEslint.configs.recommended,
12+
...tsEslint.configs.strict,
13+
...tsEslint.configs.stylistic,
14+
{
15+
ignores: [
16+
'**/[Ss]amples/**', // cspell:disable-line
17+
'**/[Tt]emp/**',
18+
'**/*.d.mts',
19+
'**/*.d.ts',
20+
'**/*.json',
21+
'**/*.map',
22+
'**/*.snap',
23+
'**/*.yaml',
24+
'**/*.yml',
25+
'**/coverage/**',
26+
'**/dist/**',
27+
'**/node_modules/**',
28+
'fixtures/*/lib*/**',
29+
'fixtures/*/out/**',
30+
],
31+
},
32+
{
33+
plugins: {
34+
'simple-import-sort': simpleImportSort,
35+
},
36+
rules: {
37+
'simple-import-sort/imports': 'error',
38+
'simple-import-sort/exports': 'error',
39+
},
40+
},
41+
{
42+
files: ['**/*.{ts,cts,mts,tsx}'],
43+
rules: {
44+
// Note: you must disable the base rule as it can report incorrect errors
45+
'no-unused-vars': 'off',
46+
'@typescript-eslint/consistent-type-imports': ['error'],
47+
'@typescript-eslint/explicit-function-return-type': 'error',
48+
'@typescript-eslint/no-empty-function': 'off',
49+
'@typescript-eslint/no-empty-interface': 'error',
50+
'@typescript-eslint/no-inferrable-types': 'off', // This is useful for type annotations in function parameters and return types.
51+
'@typescript-eslint/no-non-null-assertion': 'error',
52+
'@typescript-eslint/prefer-literal-enum-member': 'off',
53+
'@typescript-eslint/unified-signatures': 'off', // The signatures come from VS Code, it is better to have them match the source.
54+
'@typescript-eslint/no-unused-vars': [
55+
'error',
56+
{
57+
args: 'all',
58+
argsIgnorePattern: '^_',
59+
caughtErrors: 'all',
60+
caughtErrorsIgnorePattern: '^_',
61+
destructuredArrayIgnorePattern: '^_',
62+
varsIgnorePattern: '^_',
63+
ignoreRestSiblings: true,
64+
},
65+
],
66+
'n/no-missing-import': [
67+
'off', // disabled because it is not working correctly
68+
{
69+
tryExtensions: ['.d.ts', '.d.mts', '.d.cts', '.ts', '.cts', '.mts', '.js', '.cjs', '.mjs'],
70+
},
71+
],
72+
},
73+
},
74+
{
75+
files: ['**/*.test.*', '**/__mocks__/**', '**/test/**', '**/test.*', '**/rollup.config.mjs', '**/build.mjs'],
76+
rules: {
77+
'n/no-extraneous-require': 'off', // Mostly for __mocks__ and test files
78+
'n/no-extraneous-import': 'off',
79+
'n/no-unpublished-import': 'off',
80+
'@typescript-eslint/no-explicit-any': 'off', // any is allowed in tests
81+
'@typescript-eslint/no-useless-constructor': 'off', // useful for tests
82+
'@typescript-eslint/no-dynamic-delete': 'off', // useful for tests
83+
},
84+
},
85+
{
86+
files: ['**/jest.config.*', '**/__mocks__/**'],
87+
rules: {
88+
'n/no-extraneous-require': 'off',
89+
'no-undef': 'off',
90+
},
91+
},
92+
);

package.json

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.1.1",
44
"description": "A simple text based histogram and chart generator",
55
"type": "module",
6-
"packageManager": "pnpm@8.15.7",
6+
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184",
77
"module": "dist/index.js",
88
"exports": {
99
".": "./dist/index.js"
@@ -31,21 +31,16 @@
3131
"license": "MIT",
3232
"devDependencies": {
3333
"@eslint/js": "^9.30.1",
34-
"@tsconfig/node18": "^18.2.4",
35-
"@typescript-eslint/eslint-plugin": "^7.18.0",
36-
"@typescript-eslint/parser": "^7.18.0",
34+
"@tsconfig/node20": "^20.1.6",
3735
"@vitest/coverage-istanbul": "^3.2.4",
38-
"cspell": "^8.19.4",
39-
"eslint": "^8.57.1",
40-
"eslint-config-prettier": "^10.1.5",
41-
"eslint-import-resolver-typescript": "^4.4.4",
42-
"eslint-plugin-import": "^2.32.0",
43-
"eslint-plugin-node": "^11.1.0",
44-
"eslint-plugin-prettier": "^5.5.1",
45-
"eslint-plugin-promise": "^7.2.1",
36+
"cspell": "^9.1.2",
37+
"eslint": "^9.30.1",
38+
"eslint-plugin-n": "^17.21.0",
4639
"eslint-plugin-simple-import-sort": "^12.1.1",
47-
"inject-markdown": "^3.1.4",
40+
"inject-markdown": "^4.0.0",
41+
"prettier": "^3.6.2",
4842
"typescript": "^5.8.3",
43+
"typescript-eslint": "^8.35.1",
4944
"vitest": "^3.2.4"
5045
},
5146
"files": [
@@ -55,6 +50,6 @@
5550
"!**/*.map.*"
5651
],
5752
"engines": {
58-
"node": ">=18.0.0"
53+
"node": ">=20.18.0"
5954
}
6055
}

0 commit comments

Comments
 (0)