Giter VIP home page Giter VIP logo

Comments (26)

cpojer avatar cpojer commented on May 18, 2024 4

I strongly believe the community org should directly follow the React Native main repo. Having a common set of standards shared with the main repo will make it less confusing for everyone and easier to collaborate, as well as move code from one repository to others. The react-native-cli repo for example uses bracket spacing and doesn't use trailing commas. I think it would be best to invert those settings and align with RN.

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024 3

To start, I would recommend unifying the prettier config, and worrying about the eslint stuff later.

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024 3

I'm fine with short term duplication. I care more about making sure react-native-community follows the react-native repo for now.

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024 3

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024 2

Yeah, go for it. I guess if you can publish a react-native-community eslint + prettier config based on RN that all downstream projects use, that would be ideal. Even better if we could adopt that in RN too.

from discussions-and-proposals.

mmazzarolo avatar mmazzarolo commented on May 18, 2024 1

I would suggest using the default prettier preset + the create-react-app eslint config (using eslint-config-react-app or eslint-plugin-react-app) but I'm not sure if enforcing them (or any other ruleset, like a TSLint config) would be a good approach.

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024 1

from discussions-and-proposals.

kelset avatar kelset commented on May 18, 2024

Uhm can't we use simply enforce the one FB uses for the main repo?

@TheSavior what do you think?

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

eslint-config-fb is part of this repository: https://github.com/facebook/fbjs that clearly states:

Note: If you are consuming the code here and you are not also a Facebook project, be prepared for a bad time. APIs may appear or disappear and we may not follow semver strictly, though we will do our best to. This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. In order for us to move fast and ship projects like React and Relay, we've made the decision to not support everybody. We probably won't take your feature requests unless they align with our needs. There will be overlap in functionality here and in other open source projects.

Don't want to run into problems if someone internally changes the configuration. I think that having our own would be a bit better as far as decoupling.

from discussions-and-proposals.

TheSavior avatar TheSavior commented on May 18, 2024

I don’t think that is the one we use for React Native. We use the eslintrc that is in the root of the repo. In fact all js code on our mobile monorepo at FB extends from the React Native config.

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

In order to do it, we would need to create a preset somewhere else than in "fbjs" repository to avoid consuming private projects.

See this comment for details: #65 (comment)

Since this may require Facebook to invest some time into making it an independent, open-source, project, I think we can create a "react-native-community" preset, e.g. react-native-community/eslint-config-react-native-community, that "extends" Facebook one.

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

Do you want me to create a new repository then?

from discussions-and-proposals.

TheSavior avatar TheSavior commented on May 18, 2024

Once the core repo has a monorepo organization and can host multiple packages we should have the config package there. All JS in FB’s mobile monorepo extends from React Native’s eslint config so moving it to a separate repo might cause some additional pain for FB.

from discussions-and-proposals.

michalchudziak avatar michalchudziak commented on May 18, 2024

I can migrate eslint-config-fbjs to react-native-community/eslint-config-react-native-community if you still need an additional pair of hands to help.

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

from discussions-and-proposals.

TheSavior avatar TheSavior commented on May 18, 2024

I don't think we want eslint-config-fbjs. I think we want this file from the react-native repo: https://github.com/facebook/react-native/blob/master/.eslintrc

from discussions-and-proposals.

grabbou avatar grabbou commented on May 18, 2024

from discussions-and-proposals.

kelset avatar kelset commented on May 18, 2024

Ideally we’ll keep it in the RN repo and reuse it in the community repos.

single source of truth FTW 👍

from discussions-and-proposals.

michalchudziak avatar michalchudziak commented on May 18, 2024

@TheSavior thanks for the heads up!

@cpojer What's the advantage of keeping it in react-native repo? I feel like it would be cleaner to keep in separately in the community, it's just an opinion tho.

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024

@michalchudziak React Native will use the same settings and it's the source of truth. We use those internally at FB as well. Basically I want to extract what we use in RN into a separate package that is then used within RN and in the community packages.

from discussions-and-proposals.

SimenB avatar SimenB commented on May 18, 2024

Sorta, kinda, in a weird way, related: could that hypothetical package take over for eslint-config-fb-strict which lives in the Jest monorepo? https://github.com/facebook/jest/tree/master/packages/eslint-config-fb-strict

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024

I think that package is stricter than what React Native uses, no?

from discussions-and-proposals.

SimenB avatar SimenB commented on May 18, 2024

IDK, I haven't looked at the rules. But makes sense to me to converge on some strict config and not have yet another version? Maybe not

from discussions-and-proposals.

cpojer avatar cpojer commented on May 18, 2024

We now have an eslint plugin that is shared across some projects. Let's make sure all projects adopt it.

from discussions-and-proposals.

kelset avatar kelset commented on May 18, 2024

Closing this in favour of the issue section of https://github.com/react-native-community/.github/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc where we are tackling this in more details

from discussions-and-proposals.

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.