Skip to content

Commit 044d1d5

Browse files
chore: upgrade ESLint and TypeScript tooling
Upgrade the root development tooling: - eslint to 10.3.0 - typescript to 6.0.3 - typescript-eslint and @typescript-eslint/rule-tester to 8.59.3 - eslint-config-prettier to 10.1.8 - eslint-plugin-prettier to 5.5.5 - eslint-plugin-unused-imports to 4.4.1 - @types/eslint to 9.6.1 - @types/estree to 1.0.9 - @types/node to 24.12.4 Refresh yarn.lock for the updated dependency graph. Compatibility changes: - Allow ESLint 10 in @softarc/eslint-plugin-sheriff peer dependencies. - Add TypeScript 6 deprecation acknowledgement in tsconfig.base.json. - Replace Array.prototype.at() usage in library code so the current es2017 lib still type-checks. - Update ESLint rule context access to use current ESLint 10 properties instead of removed/deprecated methods. Verification performed: - yarn lint:all passed. - ./node_modules/.bin/tsc -p packages/core/tsconfig.lib.json --noEmit passed. - ./node_modules/.bin/tsc -p packages/eslint-plugin/tsconfig.lib.json --noEmit passed. - yarn vitest --run passed: 43 files, 347 passed, 2 skipped. Known remaining environment/test notes: - yarn test:ci still fails in the full integration specs because built package resolution cannot find @softarc/sheriff-core. - yarn build:all could not complete in the Codex sandbox because Nx project graph/daemon handling failed around Unix socket/plugin-worker startup. - Direct TypeScript package checks passed, so the dependency migration itself is type-safe in this workspace. Session context for resuming: This was done after checking current npm registry metadata for ESLint, TypeScript, and typescript-eslint. The compatible path identified was ESLint 10.3.0, TypeScript 6.0.3, and typescript-eslint 8.59.3, whose peer ranges include ESLint 10 and TypeScript >=4.8.4 <6.1.0.
1 parent 33a7db4 commit 044d1d5

7 files changed

Lines changed: 388 additions & 299 deletions

File tree

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
"@commitlint/prompt-cli": "^19.3.1",
2626
"@nx/js": "20.0.7",
2727
"@nx/workspace": "20.0.7",
28-
"@types/eslint": "^8.4.6",
29-
"@types/estree": "^1.0.0",
30-
"@types/node": "18.19.14",
31-
"@typescript-eslint/rule-tester": "^8.5.0",
28+
"@types/eslint": "^9.6.1",
29+
"@types/estree": "^1.0.9",
30+
"@types/node": "24.12.4",
31+
"@typescript-eslint/rule-tester": "^8.59.3",
3232
"@vitest/coverage-v8": "^2.0.3",
33-
"eslint": "^9.6.0",
34-
"eslint-config-prettier": "^9.1.0",
35-
"eslint-plugin-prettier": "^5.1.3",
36-
"eslint-plugin-unused-imports": "^4.0.0",
33+
"eslint": "^10.3.0",
34+
"eslint-config-prettier": "^10.1.8",
35+
"eslint-plugin-prettier": "^5.5.5",
36+
"eslint-plugin-unused-imports": "^4.4.1",
3737
"husky": "^9.0.11",
3838
"nx": "20.0.7",
3939
"prettier": "^3.2.5",
4040
"ts-node": "10.9.1",
41-
"typescript": "5.5.3",
42-
"typescript-eslint": "^8.5.0",
41+
"typescript": "6.0.3",
42+
"typescript-eslint": "^8.59.3",
4343
"vitest": "^2.0.3"
4444
}
4545
}

packages/core/src/lib/fs/virtual-fs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export class VirtualFs extends Fs {
215215
exists: true,
216216
node,
217217
parent: node.parent,
218-
nodeName: paths.at(-1) ?? '',
218+
nodeName: paths[paths.length - 1] ?? '',
219219
};
220220
};
221221

packages/core/src/lib/modules/create-modules.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ function findClosestModulePath(path: string, modulePaths: FsPath[]) {
6161
return throwIfNull(
6262
modulePaths
6363
.filter((modulePath) => path.startsWith(modulePath))
64-
.sort((p1, p2) => (p1.length > p2.length ? -1 : 1))
65-
.at(0),
64+
.sort((p1, p2) => (p1.length > p2.length ? -1 : 1))[0],
6665
`findClosestModule for ${path}`,
6766
);
6867
}

packages/eslint-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {},
1717
"peerDependencies": {
1818
"@softarc/sheriff-core": "0.19.6",
19-
"eslint": "^8.0.0 || ^9.0.0",
19+
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0",
2020
"@typescript-eslint/utils": "^5.48.2 || ^6.0.0 || ^7.0.0 || ^8.0.0-alpha.20"
2121
}
22-
}
22+
}

packages/eslint-plugin/src/lib/rules/create-rule.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Rule } from 'eslint';
2-
import {Executor, ExecutorNode} from './executor';
2+
import { Executor, ExecutorNode } from './executor';
33
import { UserError } from '@softarc/sheriff-core';
44

55
/**
@@ -20,12 +20,9 @@ export const createRule: (
2020
create: (context) => {
2121
let isFirstRun = true;
2222
let hasInternalError = false;
23-
const executeRuleWithContext = (
24-
node: ExecutorNode,
25-
) => {
26-
const filename = context.filename ?? context.getFilename();
27-
const sourceCode =
28-
context.sourceCode?.text ?? context.getSourceCode().text;
23+
const executeRuleWithContext = (node: ExecutorNode) => {
24+
const filename = context.filename;
25+
const sourceCode = context.sourceCode.text;
2926

3027
if (!hasInternalError) {
3128
try {

tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"sourceMap": true,
66
"declaration": false,
77
"moduleResolution": "node",
8+
"ignoreDeprecations": "6.0",
89
"emitDecoratorMetadata": true,
910
"experimentalDecorators": true,
1011
"importHelpers": false,

0 commit comments

Comments
 (0)