0

In my Angular (typescript) project lint only allows camel-case but I'm getting my response in snake-case. Is there any way besides disabling the lint or getting the keys changed from the backend?

response {profile_id: 123}

my model in TS interface Profile{ profile_id: number}

but I'm facing lint issues if I define my model like that. I can only define it as interface Profile{ profileId: number}

  • Does this answer your question? [How to disable a ts rule for a specific line?](https://stackoverflow.com/questions/43618878/how-to-disable-a-ts-rule-for-a-specific-line) – Alejandro Feb 25 '22 at 14:11
  • Unless you wan't to `any`fy all of your responses, there's not really a clean way to map the response object to your (lint-friendly) interface. –  Feb 25 '22 at 14:28
  • You could map your response to your interface using rxjs map operator, I don't think there's a way to do this automatically (unless you write your own auto mapper which converts snake case to camel case - there's some examples online) – Nathan Feb 25 '22 at 19:10

0 Answers0