diff --git a/.eslintrc.json b/.eslintrc.json index bc86917..25c4392 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,25 @@ "extends": "next/core-web-vitals", "rules": { "import/no-duplicates": ["error", { "considerQueryString": true }], - "no-duplicate-imports": "off" - } + "no-duplicate-imports": "off", + "no-restricted-syntax": [ + "error", + { + "selector": "FunctionDeclaration[id.name='withTimeout']", + "message": "Use withTimeout from @/lib/with-timeout instead of defining a local copy." + }, + { + "selector": "VariableDeclarator[id.name='withTimeout'][init.type='FunctionExpression'], VariableDeclarator[id.name='withTimeout'][init.type='ArrowFunctionExpression']", + "message": "Use withTimeout from @/lib/with-timeout instead of assigning a local copy." + } + ] + }, + "overrides": [ + { + "files": ["lib/with-timeout.ts"], + "rules": { + "no-restricted-syntax": "off" + } + } + ] }