Comments (26)
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.
To start, I would recommend unifying the prettier config, and worrying about the eslint stuff later.
from discussions-and-proposals.
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.
from discussions-and-proposals.
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.
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.
from discussions-and-proposals.
Uhm can't we use simply enforce the one FB uses for the main repo?
@TheSavior what do you think?
from discussions-and-proposals.
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.
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.
from discussions-and-proposals.
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.
Do you want me to create a new repository then?
from discussions-and-proposals.
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.
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.
from discussions-and-proposals.
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.
from discussions-and-proposals.
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.
@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.
@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.
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.
I think that package is stricter than what React Native uses, no?
from discussions-and-proposals.
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.
We now have an eslint plugin that is shared across some projects. Let's make sure all projects adopt it.
from discussions-and-proposals.
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)
- React Native Not Showing Last Record Entered HOT 1
- LibWebP vulnerability affecting react native apps HOT 4
- Add duration parameter to Animated.spring
- Support for basic structures such as Splash Screen, App Icon, Package Name
- we need official static or dynamic react-native library for iOS HOT 1
- The way scroll views work in react native is extremely unintuitive
- [0.73] Experimental New Debugger — Known Issues and Feedback
- synchronous JSI call and remote debugging HOT 5
- Alert prompt support for Android would be handy HOT 2
- WeakRef support HOT 5
- (Feature): Add SWC support
- API to detect if 'Developer Options' are enabled in Android HOT 2
- [Web] Avoid react updates on each animation frame HOT 1
- Android - Disable context menu for TextInput component HOT 1
- Merge dynamic link library HOT 6
- Import image like React js HOT 2
- how can i use `threadsafe.h` from JSI?
- Improve error messages
- WebTransport support in RN
- is there a way to specify "Debug server host & port for device" in the command line at startup. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discussions-and-proposals.