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

202
Views
How to find the eslint rules for react with typescript?

So I have set of rules of ESLint that I was using in react with javascript but now I am using typescript in my new project but I am not getting which rules should be used for typescript.

Set of rules while using javascript:

 rules: {
    'react/jsx-filename-extension': [
      1,
      { extensions: [ '.js', '.jsx'] },
    ],
    'react/jsx-props-no-spreading': 'off',
    'no-use-before-define': [
      'error',
      { functions: true, classes: true, variables: false },
    ],
    'react/react-in-jsx-scope': 'off',
    'no-prototype-builtins': 'off',
   'react/function-component-definition': [ 2, { namedComponents: 'function-declaration', }, 
],
  }

Set of rules while using typescript:

"rules": {
    "react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
    "react/jsx-props-no-spreading": "off",
    "no-use-before-define": "off",
    "@typescript-eslint/no-use-before-define": [
      "error",
      { "functions": true, "classes": true, "variables": false }
    ],
    "react/react-in-jsx-scope": "off",
    "no-prototype-builtins": "off",
    "react/function-component-definition": [
      2,
      { "namedComponents": "function-declaration" }
    ]
  }

Here while using typescript we have to first turn off the no-use-before-define then use the typescript alternative of the same that is @typescript-eslint/no-use-before-define. So what are the alternatives for other rules if any?

about 4 years ago · Juan Pablo Isaza
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!