Persist one browser user agent for Axios and WebSockets
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user