Persist one browser user agent for Axios and WebSockets

This commit is contained in:
Brandon Li
2026-10-19 06:08:23 -05:00
parent 13e03c3d0f
commit ed56e306d1
21 changed files with 380 additions and 64 deletions
+23
View File
@@ -5,6 +5,29 @@ import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
ignores: ['lib/http-client.ts', 'lib/outbound-proxy.ts'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['axios', 'axios/*'],
message: 'Import Axios from @/lib/http-client so requests keep the saved user agent, proxy and timeout.',
}],
}],
'no-restricted-modules': ['error', {
paths: [{
name: 'axios',
message: 'Use @/lib/http-client for the configured Axios client.',
}],
patterns: ['axios/*'],
}],
'no-restricted-syntax': ['error', {
selector: 'ImportExpression[source.value=/^axios(\\/|$)/]',
message: 'Import @/lib/http-client for the configured Axios client.',
}],
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next: