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