Add Prettier Formatting (#258)

* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs

* Remove trailing-comma as we are using Node 6 on Circle

* Use latest Node 6 LTS version in Circle

* Remove unused test
This commit is contained in:
Héctor Ramos 2017-12-04 19:21:02 -08:00 committed by Joel Marcey
parent 0cead4b6f9
commit 65421db62e
50 changed files with 1376 additions and 1350 deletions

View file

@ -5,27 +5,27 @@
* LICENSE file in the root directory of this source tree.
*/
const MarkdownBlock = require("./MarkdownBlock.js");
const React = require("react");
const MarkdownBlock = require('./MarkdownBlock.js');
const React = require('react');
// inner blog component for the article itself, without sidebar/header/footer
class BlogPost extends React.Component {
renderContent() {
let content = this.props.content;
let hasSplit = false;
if (content.split("<!--truncate-->").length > 1) {
if (content.split('<!--truncate-->').length > 1) {
hasSplit = (
<div className="read-more">
<a
className="button"
href={this.props.config.baseUrl + "blog/" + this.props.post.path}>
href={this.props.config.baseUrl + 'blog/' + this.props.post.path}>
Read More
</a>
</div>
);
}
if (this.props.truncate) {
content = content.split("<!--truncate-->")[0];
content = content.split('<!--truncate-->')[0];
return (
<article className="post-content">
<MarkdownBlock>{content}</MarkdownBlock>
@ -39,17 +39,17 @@ class BlogPost extends React.Component {
renderAuthorPhoto() {
const post = this.props.post;
const className =
"authorPhoto" +
(post.author && post.authorTitle ? " authorPhoto-big" : "");
'authorPhoto' +
(post.author && post.authorTitle ? ' authorPhoto-big' : '');
if (post.authorFBID) {
return (
<div className={className}>
<a href={post.authorURL} target="_blank">
<img
src={
"https://graph.facebook.com/" +
'https://graph.facebook.com/' +
post.authorFBID +
"/picture/?height=200&width=200"
'/picture/?height=200&width=200'
}
/>
</a>
@ -72,7 +72,7 @@ class BlogPost extends React.Component {
const post = this.props.post;
return (
<h1>
<a href={this.props.config.baseUrl + "blog/" + post.path}>
<a href={this.props.config.baseUrl + 'blog/' + post.path}>
{post.title}
</a>
</h1>
@ -85,18 +85,18 @@ class BlogPost extends React.Component {
// Because JavaScript sucks at date handling :(
const year = match[1];
const month = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
][parseInt(match[2], 10) - 1];
const day = parseInt(match[3], 10);