Skip to content

Commit e48fec9

Browse files
committed
Require Node.js 22
1 parent 87bd178 commit e48fec9

5 files changed

Lines changed: 23 additions & 30 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ jobs:
1212
node-version:
1313
- 24
1414
- 22
15-
- 20
1615
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
1918
with:
2019
node-version: ${{ matrix.node-version }}
2120
- run: npm install
2221
- run: npm test
23-
# - uses: codecov/codecov-action@v1
24-
# if: matrix.node-version == 14
25-
# with:
26-
# fail_ci_if_error: true

lib/utils.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@ Validate an XO config array for legacy ESLint config properties that are not sup
9393
@param xoConfig - The flat XO config to validate.
9494
*/
9595
export const validateXoConfig = (xoConfig: XoConfigItem[]): void => {
96-
for (const [index, config] of xoConfig.entries()) {
97-
if (index === 0) {
98-
continue; // Skip internal base config prepended by XO
99-
}
100-
96+
// Skip the first item (internal base config prepended by XO)
97+
for (const config of xoConfig.values().drop(1)) {
10198
for (const key of Object.keys(config)) {
10299
const hint = legacyPropertyHints[key];
103100
if (hint) {
@@ -122,18 +119,13 @@ export const preProcessXoConfig = (xoConfig: XoConfigItem[]): {config: XoConfigI
122119
const tsFilesGlob: string[] = [];
123120
const tsFilesIgnoresGlob: string[] = [];
124121

125-
const processedConfig: XoConfigItem[] = [];
122+
// The first config item is the internal base config; push it through unmodified.
123+
const processedConfig: XoConfigItem[] = xoConfig[0] ? [{...xoConfig[0]}] : [];
126124

127-
for (const [idx, {...config}] of xoConfig.entries()) {
125+
for (const {...config} of xoConfig.values().drop(1)) {
128126
const languageOptions = config.languageOptions as Linter.LanguageOptions | undefined;
129127
const parserOptions = languageOptions?.parserOptions as TypeScriptParserOptions | undefined;
130128

131-
// We can skip the first config item, as it is the base config item.
132-
if (idx === 0) {
133-
processedConfig.push(config);
134-
continue;
135-
}
136-
137129
// Use TS parser/plugin for JS files if the config contains TypeScript rules which are applied to JS files.
138130
// typescript-eslint rules set to "off" are ignored and not applied to JS files.
139131
if (

lib/xo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export class Xo {
675675
});
676676

677677
if (nextVirtualFiles.size > 0) {
678-
const filesArray = [...nextVirtualFiles];
678+
const filesArray = nextVirtualFiles.values().toArray();
679679
const relativeFiles = filesArray.map(file => path.relative(this._linterOptions.cwd, file));
680680

681681
const tsconfigContent = {

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"sideEffects": false,
2020
"engines": {
21-
"node": ">=20.19"
21+
"node": ">=22"
2222
},
2323
"scripts": {
2424
"build": "npm run clean && tsc",
@@ -67,10 +67,10 @@
6767
"typescript"
6868
],
6969
"dependencies": {
70-
"@eslint/compat": "^2.0.2",
70+
"@eslint/compat": "^2.0.3",
7171
"@sindresorhus/tsconfig": "^8.1.0",
7272
"arrify": "^3.0.0",
73-
"cosmiconfig": "^9.0.0",
73+
"cosmiconfig": "^9.0.1",
7474
"define-lazy-prop": "^3.0.0",
7575
"eslint": "^10.1.0",
7676
"eslint-config-prettier": "^10.1.8",
@@ -80,22 +80,22 @@
8080
"eslint-plugin-prettier": "^5.5.5",
8181
"find-cache-directory": "^6.0.0",
8282
"get-stdin": "^10.0.0",
83-
"get-tsconfig": "^4.13.6",
83+
"get-tsconfig": "^4.13.7",
8484
"globby": "^16.2.0",
85-
"jiti": "^2.2.0",
85+
"jiti": "^2.6.1",
8686
"meow": "^14.1.0",
8787
"micromatch": "^4.0.8",
8888
"open-editor": "^6.0.0",
8989
"path-exists": "^5.0.0",
9090
"prettier": "^3.8.1",
91-
"type-fest": "^5.4.3",
91+
"type-fest": "^5.5.0",
9292
"typescript": "^6.0.2"
9393
},
9494
"devDependencies": {
95-
"@types/node": "^25.2.1",
96-
"@types/micromatch": "^4.0.8",
95+
"@types/node": "^25.5.0",
96+
"@types/micromatch": "^4.0.10",
9797
"ava": "^7.0.0",
98-
"dedent": "^1.7.1",
98+
"dedent": "^1.7.2",
9999
"eslint-plugin-vue": "^10.8.0",
100100
"execa": "^9.6.1",
101101
"husky": "^9.1.7",

tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"extends": "@sindresorhus/tsconfig",
33
"compilerOptions": {
44
"outDir": "dist",
5+
"lib": [
6+
"DOM",
7+
"DOM.Iterable",
8+
"ES2023",
9+
"ES2025.Iterator"
10+
],
511
"resolveJsonModule": true,
612
"sourceMap": true
713
},

0 commit comments

Comments
 (0)