Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

333
Views
Typescript: Disabling es-lint rule for only an interface?

I have the rule in my project to disallow variables not in camelcase. I am hitting an external API where the response comes back with an object that has variables in camelcase. When I define a type:

interface AgeData {
    name: string,
    corner: number
}

interface APIResp {
    file_name: string,
    data_info: AgeData[],
    interest_m: number
}

I need to use camelcase for the expected format back from the API since I can't control the external API.
Throughout the rest of my code, I use:

// eslint-disable-next-line camelcase

to disable it but this doesn't seem to work for interfaces.
I don't want to change the rule or override it. It's a fairly large project and I just want it this one interface.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't think camelcase can be as type-aware as you're hoping for, but what it can do is:

  • Permit property names to have underscores (or forbid property names to have underscores). This is separate from permitting standalone identifiers from having underscores. Or
  • Permit specific whitelisted property names even if they don't match the pattern.

So, one way is to use the following config for the ESLint rule:

[
  'error',
  {
    allow: ['file_name', 'data_info', 'interest_m']
  }
]
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!