no-httpxhrbackend

August 20, 2026 · View on GitHub

Restrict the usage of HttpXhrBackend, which enables back legacy XHR based HTTP.

Stay on the default fetch based HTTP instead.

Documentation

Configuration

  • in the recommended preset
  • in the fetchHttp preset
  • or just this rule:
{
  rules: {
    'eslint-plugin-angular-modern/no-httpxhrbackend': 'error'
  }
}

Tip

See the README for the global and presets configuration.

❌ Invalid

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(),
    { provide: HttpBackend, useClass: HttpXhrBackend },
  ],
};

✅ Valid

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(),
  ],
};

Back to README