chore(eslint): replace no-restricted-imports with no-restricted-syntax for require() compat

This commit is contained in:
null 2026-07-10 17:51:59 -05:00
parent b76772b8eb
commit 4e3523b2e7
1 changed files with 5 additions and 8 deletions

View File

@ -72,16 +72,13 @@ export default [
files: ['routes/**/*.cts'], files: ['routes/**/*.cts'],
ignores: ['routes/transactions.cts', 'routes/import.cts'], ignores: ['routes/transactions.cts', 'routes/import.cts'],
rules: { rules: {
'no-restricted-imports': [ // no-restricted-imports can't see require() — match the call itself.
'no-restricted-syntax': [
'error', 'error',
{ {
paths: [ selector: "CallExpression[callee.name='require'] Literal[value=/errorFormatter/]",
{ message:
name: '../middleware/errorFormatter.cts', 'Routes emit errors by throwing utils/apiError.cts factories (see CODE_STANDARDS.md); the terminal handler formats them.',
message:
'Routes emit errors by throwing utils/apiError.cts factories (see CODE_STANDARDS.md); the terminal handler formats them.',
},
],
}, },
], ],
}, },