Skip to content
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

React-PropTypes-to-prop-types removes new line at end of file #202

Closed
florentdestremau opened this issue Feb 20, 2018 · 3 comments
Closed

Comments

@florentdestremau
Copy link

It may be the case for all scripts but this is very annoying (95 files for me !). So my git diff is full of these:

index 652ecf8..899442e 100644
--- a/front/react/components/Checkout/CardForm.js
+++ b/front/react/components/Checkout/CardForm.js
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
 import React, { Component } from 'react';
 import autobind from 'autobind-decorator';
 import { postNewCard } from '../../services/network';
@@ -5,8 +6,8 @@ import '../../assets/card.css';
 import Spinner from '../Spinner';
 
 const propTypes = {
-  updateCreditCards: React.PropTypes.func,
-  successMethod: React.PropTypes.func,
+  updateCreditCards: PropTypes.func,
+  successMethod: PropTypes.func,
 };
 
 class CardForm extends Component {
@@ -137,4 +138,4 @@ class CardForm extends Component {
 }
 
 CardForm.propTypes = propTypes;
-export default autobind(CardForm);
+export default autobind(CardForm);
\ No newline at end of file

Could this be prevented ?

@grumd
Copy link

grumd commented Mar 6, 2018

Same issue for me, but it's for 1007 files.

@threepointone
Copy link
Contributor

I'll accept a PR with a fix. You could also run prettier (or some other formatter) on the output.

@threepointone
Copy link
Contributor

Closing this since there are workarounds (like using prettier), but happy to accept a PR if someone makes it.

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

No branches or pull requests

3 participants