From 4e3523b2e7fa735834686b9cf39c935a919f153d Mon Sep 17 00:00:00 2001 From: null Date: Fri, 10 Jul 2026 17:51:59 -0500 Subject: [PATCH] chore(eslint): replace no-restricted-imports with no-restricted-syntax for require() compat --- eslint.config.mjs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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.', }, ], },