Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda