forked from facebook/jscodeshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request facebook#28 from lencioni/sort-comp-es6-class
Add support for ES6 classes in sort-comp
- Loading branch information
Showing
5 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var React = require('react/addons'); | ||
|
||
const propTypes = {}; | ||
|
||
// comment above class | ||
class MyComponent extends React.Component { | ||
// comment at top of createClass | ||
// this will be attached to first method | ||
|
||
render() { | ||
return <div />; | ||
} | ||
|
||
// comment on componentDidMount | ||
componentDidMount() { | ||
} | ||
|
||
renderFoo() { | ||
// other render* function | ||
} | ||
|
||
renderBar() { | ||
// should come before renderFoo | ||
} | ||
|
||
myOwnMethod(foo) { | ||
// comment within method | ||
} | ||
|
||
} | ||
|
||
MyComponent.propTypes = propTypes; | ||
|
||
/* comment at end */ | ||
module.exports = MyComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var React = require('react/addons'); | ||
|
||
const propTypes = {}; | ||
|
||
// comment above class | ||
class MyComponent extends React.Component { | ||
// comment on componentDidMount | ||
componentDidMount() { | ||
} | ||
|
||
myOwnMethod(foo) { | ||
// comment within method | ||
} | ||
|
||
renderBar() { | ||
// should come before renderFoo | ||
} | ||
|
||
renderFoo() { | ||
// other render* function | ||
} | ||
|
||
// comment at top of createClass | ||
// this will be attached to first method | ||
|
||
render() { | ||
return <div />; | ||
} | ||
|
||
} | ||
|
||
MyComponent.propTypes = propTypes; | ||
|
||
/* comment at end */ | ||
module.exports = MyComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters