Giter Club home page Giter Club logo

Comments (4)

robertrossmann avatar robertrossmann commented on May 29, 2024 2

As for react/prop-types I think it is best left to the user to turn the rule off. Solving for all possible permutations of rulesets x languages x project technologies could quite quickly blow on us. 💣 🔥 The easiest way to silence that rule for TS files would be to use an overrides[] stanza in .eslintrc.js and disable that rule for all .ts & .tsx files. 🤔

from code-quality-tools.

lazarofl avatar lazarofl commented on May 29, 2024 1

You can just specify which extensions are allowed for this rule at .eslintrc.jsonconfig file.

{
    "rules": {
        "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
    }
}

from code-quality-tools.

andrenanninga avatar andrenanninga commented on May 29, 2024

react/prop-types is another that could be entirely turned off for typescript.

from code-quality-tools.

robertrossmann avatar robertrossmann commented on May 29, 2024

I'd even suggest to drop the react/jsx-filename-extension rule completely. I vaguely recall a chat with someone from Frontend team that they do not want to use react components only in .jsx files but also in .js files. What matters most is how the project is compiled and not what extension is being used.

I'll drop the rule. Flow users would hit similar problem with their .flow extensions and I bet there are other compile-to-js languages which use JSX syntax with other, exotic file extensions. 🤷‍♂️

from code-quality-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.