Skip to content

Commit 735c5d9

Browse files
committed
chore(lint): align the ESLint and TypeScript lint toolchain
Transplanted-From: 5bf7793 (remediation pack 2026-07-20)
1 parent 522d891 commit 735c5d9

3 files changed

Lines changed: 39 additions & 3 deletions

File tree

eslint.config.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
import eslint from '@eslint/js';
22
import tseslint from 'typescript-eslint';
3+
34
export default tseslint.config(
4-
{ ignores: ['dist/**', 'node_modules/**'] },
5+
{ ignores: ['dist/**', 'node_modules/**', 'artifacts/**', 'coverage/**'] },
56
eslint.configs.recommended,
67
...tseslint.configs.recommended,
8+
{
9+
files: ['src/**/*.ts'],
10+
rules: {
11+
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
12+
'@typescript-eslint/no-explicit-any': 'warn',
13+
},
14+
},
15+
{
16+
files: ['src/**/*.ts'],
17+
ignores: ['src/index.ts', 'src/providers/**'],
18+
rules: {
19+
'no-restricted-imports': ['error', {
20+
patterns: [{
21+
group: ['**/providers/*', '**/providers/**'],
22+
message: 'Provider clients are an I/O boundary. Route production execution through src/index.ts.',
23+
}],
24+
}],
25+
},
26+
},
727
);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"zod": "^4.4.3"
3838
},
3939
"devDependencies": {
40-
"@eslint/js": "^9.39.5",
40+
"@eslint/js": "^10.0.1",
4141
"@types/node": "^20.19.43",
42-
"eslint": "^9.0.0",
42+
"eslint": "^10.7.0",
4343
"typescript": "^5.5.0",
4444
"typescript-eslint": "^8.64.0",
4545
"vitest": "^4.1.10"

tests/eslint-boundary.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { ESLint } from 'eslint';
2+
import { describe, expect, it } from 'vitest';
3+
4+
describe('ESLint provider boundary', () => {
5+
it('rejects a production provider bypass', async () => {
6+
const eslint = new ESLint({ cwd: process.cwd() });
7+
const [result] = await eslint.lintText("import { OpenRouterClient } from './providers/openrouter.js';\nvoid OpenRouterClient;\n", { filePath: 'src/boundary-probe.ts' });
8+
expect(result.messages.some(message => message.ruleId === 'no-restricted-imports' && message.severity === 2)).toBe(true);
9+
});
10+
11+
it('allows the composition root to import providers', async () => {
12+
const eslint = new ESLint({ cwd: process.cwd() });
13+
const [result] = await eslint.lintText("import { OpenRouterClient } from './providers/openrouter.js';\nvoid OpenRouterClient;\n", { filePath: 'src/index.ts' });
14+
expect(result.messages.some(message => message.ruleId === 'no-restricted-imports')).toBe(false);
15+
});
16+
});

0 commit comments

Comments
 (0)