Skip to content

feat:Adding prettier as a dev dependency and formatting the whole code#59

Closed
abhishekkumar08 wants to merge 1 commit intoreact-native-elements:masterfrom
abhishekkumar08:feat/prettier
Closed

feat:Adding prettier as a dev dependency and formatting the whole code#59
abhishekkumar08 wants to merge 1 commit intoreact-native-elements:masterfrom
abhishekkumar08:feat/prettier

Conversation

@abhishekkumar08
Copy link
Contributor

Fixes:#58

@netlify
Copy link

netlify bot commented Mar 13, 2021

Deploy preview for rne-playground ready!

Built with commit 724040f

https://deploy-preview-59--rne-playground.netlify.app

Comment on lines 28 to 34
Example:

**Snack** : https://snack.expo.io/xxx

- Steps

1. Go to '...'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try making some change, adding spaces doesn't help

Comment on lines +45 to 52

```sh
npm i
```

3. Run the development server

```sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only spaces are added to the file?

Comment on lines +34 to +35
"postinstall": "patch-package",
"format": "prettier --write \"**/*.{js,jsx,json,md}\""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid changing the packages.... (can cause merge conflict for others PR's)

"type": "image/png",
"sizes": "512x512"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • space again ?

Comment on lines +2 to 8
import {
SafeAreaInsetsContext,
SafeAreaProvider,
} from "react-native-safe-area-context";

import Root from "./containers";
import "./App.css";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make any sense. only spaces have been added all over the place.

Comment on lines -1 to -6
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";

it('renders without crashing', () => {
const div = document.createElement('div');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacements " " to ' ' and vice-a-versa.

Comment on lines +1 to 9
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import "react-native-safe-area-context";

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(<App />, document.getElementById("root"));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will create conflict for other PR's

Comment on lines +96 to 115
.catch((error) => {
console.error("Error during service worker registration:", error);
});
}

function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
const contentType = response.headers.get("content-type");
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
(contentType != null && contentType.indexOf("javascript") === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => {
window.location.reload();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacements " " to ' ' and vice-a-versa.

Comment on lines +124 to +131
"No internet connection found. App is running in offline mode."
);
});
}

export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
if ("serviceWorker" in navigator) {
navigator.serviceWorker.ready.then((registration) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacements " " to ' ' and vice-a-versa.

@Uyadav207
Copy link
Contributor

@abhishekkumar08, please have a look at ......

@abhishekkumar08
Copy link
Contributor Author

@abhishekkumar08, please have a look at ......

* https://reactnativeelements.com/docs/contributing

If you try to understand the PR, it adds prettier to the code base which is a code formatter, I just installed it as a dev dependency and ran the command for it to format the whole code base. Thanks for the review. @Uyadav207

@Uyadav207
Copy link
Contributor

Uyadav207 commented Mar 13, 2021

@abhishekkumar08, ok if it's prettier also... the changes made are quite huge and this will create merge conflict... for the previous PR, as I have faced the same problem yesterday. 😢 and had a hard time resolving conflict.

I hope you understand? 😊

@abhishekkumar08
Copy link
Contributor Author

abhishekkumar08 commented Mar 13, 2021

@Uyadav207 Yeah bro I got your point 😄 . Thanks for the suggestion, any other way how should I do this change?

Copy link
Contributor

@tewarig tewarig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but issue #56 #57 and pr made on these are almost the same adding prettier as a dev dependency is not a good idea. we need to run npm run format every time before we make a pr?
in #56 we are adding a file... which will automatically format the code in vs code if the prettier
the extension is installed.

@tewarig
Copy link
Contributor

tewarig commented Mar 13, 2021

@Uyadav207 Yeah bro I got your point. Thanks for the suggestion, any other way how should I do this change?

just keep an eye on the repo if any pr is merged in this repo make sure you update your repo and format its code again

@Uyadav207
Copy link
Contributor

but issue #56 #57 and pr made on these are almost the same adding prettier as a dev dependency is not a good idea. we need to run npm run format every time before we make a pr?

in #56 we are adding a file... which will automatically format the code in vs code if the prettier

the extension is installed.

Exactly.

@Uyadav207
Copy link
Contributor

Uyadav207 commented Mar 13, 2021

@Uyadav207 Yeah bro I got your point 😄 . Thanks for the suggestion, any other way how should I do this change?

This is a breaking change. Need to wait for all PR to get merge than if we push your change.... Then it would not cause any conflict... but syncing the fork then would be necessary for all contributors... Is this making any sense ?

@jugshaurya
Copy link
Contributor

@abhishekkumar08 already created an issue and made a PR about the same thing earlier than you. Kindly work on some other issues.

@jugshaurya
Copy link
Contributor

@Uyadav207 Yeah bro I got your point smile . Thanks for the suggestion, any other way how should I do this change?

This is a breaking change. Need to wait for all PR to get merge than if we push your change.... Then it would not cause any conflict... but syncing the fork then would be necessary for all contributors... Is this making any sense ?

@Uyadav207 Initially it may seem a conflicting change but it will be beneficial in long go as developers contributing to the project will be following same styling.

@tewarig
Copy link
Contributor

tewarig commented Mar 13, 2021

@Uyadav207 Yeah bro I got your point smile . Thanks for the suggestion, any other way how should I do this change?

This is a breaking change. Need to wait for all PR to get merge than if we push your change.... Then it would not cause any conflict... but syncing the fork then would be necessary for all contributors... Is this making any sense ?

@Uyadav207 Initially it may seem a conflicting change but it will be beneficial in long go as developers contributing to the project will be following same styling.

yes it will help a lot .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants