-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardise code style within the organisation #65
Comments
Uhm can't we use simply enforce the one FB uses for the main repo? @TheSavior what do you think? |
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. |
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. |
Right. I got confused because it’s actually a dev dependency!
…On Fri, 7 Dec 2018 at 18:29, Eli White ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWcxvJYyMIYPvpAmyypCSg97RoIn18nks5u2qVwgaJpZM4ZIAhe>
.
|
I would suggest using the default prettier preset + the create-react-app eslint config (using |
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. |
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. |
To start, I would recommend unifying the prettier config, and worrying about the eslint stuff later. |
Do you want me to create a new repository then? |
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. |
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. |
I'm fine with short term duplication. I care more about making sure react-native-community follows the react-native repo for now. |
I can migrate eslint-config-fbjs to |
Please do it Mike! Thank you!
…On Tue, 5 Feb 2019 at 18:23 Michał Chudziak ***@***.***> wrote:
I can migrate eslint-config-fbjs
<https://github.com/facebook/fbjs/tree/master/packages/eslint-config-fbjs>
to react-native-community/eslint-config-react-native-community if you
still need an additional pair of hands to help.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWcxjFt377Z2VTSts4t4ekw_LBpycSSks5vKb4HgaJpZM4ZIAhe>
.
|
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 |
I’m planning to look at this soon. I’d like this config to stay in the RN repo and be shared on npm separately.
…________________________________
From: Eli White <notifications@github.com>
Sent: Tuesday, February 5, 2019 18:35
To: react-native-community/discussions-and-proposals
Cc: Christoph Nakazawa; Comment
Subject: Re: [react-native-community/discussions-and-proposals] Standardise code style within the organisation (#65)
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#65 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAA0KAFdoZl72QLpJ09M3pRW1LaknxYfks5vKc8JgaJpZM4ZIAhe>.
|
Makes sense to use that file. @cpojer, anything in particular against React
Native Community as a location? It makes sense to me to have it here as a
community preset that is recommended to be adopted.
…On Tue, 5 Feb 2019 at 19:39, Christoph Nakazawa ***@***.***> wrote:
I’m planning to look at this soon. I’d like this config to stay in the RN
repo and be shared on npm separately.
________________________________
From: Eli White ***@***.***>
Sent: Tuesday, February 5, 2019 18:35
To: react-native-community/discussions-and-proposals
Cc: Christoph Nakazawa; Comment
Subject: Re: [react-native-community/discussions-and-proposals]
Standardise code style within the organisation (#65)
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#65 (comment)>,
or mute the thread<
https://github.com/notifications/unsubscribe-auth/AAA0KAFdoZl72QLpJ09M3pRW1LaknxYfks5vKc8JgaJpZM4ZIAhe
>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWcxmEg_fIfiJo_cKADP62FwZnVhvZ4ks5vKc_FgaJpZM4ZIAhe>
.
|
Ideally we’ll keep it in the RN repo and reuse it in the community repos. I need to move some things around to make that happen.
________________________________
From: Mike Grabowski <notifications@github.com>
Sent: Tuesday, February 5, 2019 21:06
To: react-native-community/discussions-and-proposals
Cc: Christoph Nakazawa; Mention
Subject: Re: [react-native-community/discussions-and-proposals] Standardise code style within the organisation (#65)
Makes sense to use that file. @cpojer, anything in particular against React
Native Community as a location? It makes sense to me to have it here as a
community preset that is recommended to be adopted.
On Tue, 5 Feb 2019 at 19:39, Christoph Nakazawa ***@***.***> wrote:
I’m planning to look at this soon. I’d like this config to stay in the RN
repo and be shared on npm separately.
________________________________
From: Eli White ***@***.***>
Sent: Tuesday, February 5, 2019 18:35
To: react-native-community/discussions-and-proposals
Cc: Christoph Nakazawa; Comment
Subject: Re: [react-native-community/discussions-and-proposals]
Standardise code style within the organisation (#65)
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#65 (comment)>,
or mute the thread<
https://github.com/notifications/unsubscribe-auth/AAA0KAFdoZl72QLpJ09M3pRW1LaknxYfks5vKc8JgaJpZM4ZIAhe
>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWcxmEg_fIfiJo_cKADP62FwZnVhvZ4ks5vKc_FgaJpZM4ZIAhe>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#65 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAA0KLlr5EM_MzS31Jn34sgg_ZFn75P4ks5vKfJagaJpZM4ZIAhe>.
|
single source of truth FTW 👍 |
@TheSavior thanks for the heads up! @cpojer What's the advantage of keeping it in |
@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. |
Sorta, kinda, in a weird way, related: could that hypothetical package take over for |
I think that package is stricter than what React Native uses, no? |
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 |
…23688) Summary: Basing on discussion from this issue - react-native-community/discussions-and-proposals#65 we moved ESLint/Prettier config to its own package inside packages directory. At this moment we had to left all `eslint` dependencies in root `package.json` since `eslint-config-react-native` is not published yet. [General] [Changed] - Move eslint/prettier config to packages/eslint-config-react-native Pull Request resolved: #23688 Differential Revision: D14277068 Pulled By: cpojer fbshipit-source-id: ef2d0b33210418318cc8324f15fedd84df0ef64d
We now have an eslint plugin that is shared across some projects. Let's make sure all projects adopt it. |
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 |
I am about to set up "Prettier" in my project along "ESLint" to keep it consistent across some open-source work that I do and easier for contributors to work without worrying about internal patterns.
I've noticed that we don't have a general "community" preset. There is "eslint-config-fb" that is used by React Native. Unfortunately, it's a part of a project that is not meant to be consumed by 3rd parties.
We also do have "eslint-config-callstack", which is the one that I was planning to use for the CLI. It has Prettier integrated as a ESLint rule and makes it really easy to fix all the issues within your codebase by just running eslint --fix.
However, I am afraid of several inconsistencies that this may cause across community project. For instance, there are projects that don't use Prettier or ESLint at all. There might be some that use a different preset.
Do we care enough to enforce a "standard" ESLint/Prettier config as a part of RNCommunity to make it consistent to contribute? Say, we have "react-native-community/eslint-config-react-native", which also becomes a "recommended" preset for React Native?
Or we don't care and every project is allowed to go on its own?
PS. If we do care, I am happy to do it. We can fork our "callstack" preset as it's already set up for being consumed from "npm" and just adjust the rules.
The text was updated successfully, but these errors were encountered: