Skip to content

Commit

Permalink
Fix eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-allanson committed Jun 28, 2018
1 parent cc26240 commit 69ebadc
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import BlogPostChrome from "../../components/BlogPostChrome"
import { findDOMNode } from "react-dom"
var d3 = require(`d3`)

// this is one method to export data and make it usable elsewhere
Expand All @@ -15,10 +14,6 @@ export const frontmatter = {
}

class choroplethBase extends React.Component {
constructor(props) {
super(props)
}

componentDidMount() {
this.d3Node = d3.select(`div#states`)
let measurements = {
Expand Down Expand Up @@ -127,7 +122,7 @@ average: tooltip, path fill

let states = svg.selectAll(`path.states`).data(data)

let drawStates = states
states
.enter()
.append(`path`)
.attr(`class`, `state`)
Expand Down Expand Up @@ -173,6 +168,7 @@ let mouseOut = () => {
.style(`opacity`, 0)
}

// eslint-disable-next-line no-unused-vars
function scale(scaleFactor, width, height) {
return d3.geoTransform({
point: function(x, y) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import BlogPostChrome from "../../components/BlogPostChrome"
import { findDOMNode } from "react-dom"
var d3 = require(`d3`)

// this is an additional method to export data and make it usable elsewhere
Expand All @@ -14,10 +13,6 @@ export const frontmatter = {
}

class choroplethAltBase extends React.Component {
constructor(props) {
super(props)
}

componentDidMount() {
this.d3Node = d3.select(`div#states`)
let measurements = {
Expand Down Expand Up @@ -126,7 +121,7 @@ average: tooltip, path fill

let states = svg.selectAll(`path.states`).data(data)

let drawStates = states
states
.enter()
.append(`path`)
.attr(`class`, `state`)
Expand Down Expand Up @@ -172,6 +167,7 @@ let mouseOut = () => {
.style(`opacity`, 0)
}

// eslint-disable-next-line no-unused-vars
function scale(scaleFactor, width, height) {
return d3.geoTransform({
point: function(x, y) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from "react"
import { Link } from "gatsby"
import Helmet from "react-helmet"
import moment from "moment"

import MasterLayout from "./master"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import MasterLayout from "./master"

class InsetPageLayout extends React.Component {
render() {
const siteMetadata = this.props.data.site

return (
<div className="PageTemplate">
<MasterLayout {...this.props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react"
import * as PropTypes from "prop-types"
import Helmet from "react-helmet"
import "../../static/css/base.scss"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
import React from "react"
import Helmet from "react-helmet"
import moment from "moment"

class PostPublished extends React.Component {
render() {
const frontmatter = this

let published
if (frontmatter.updated === null) {
var published = (
<div className="date-published">
<p>
<em>
published {moment(frontmatter.written).format(`D MMM YYYY`)}
</em>
</p>
</div>
published = (
<em>`published`{moment(frontmatter.written).format(`D MMM YYYY`)}</em>
)
} else {
var published = (
<div className="date-published">
<p>
<em>
originally published{` `}
{moment(frontmatter.written).format(`D MMM YYYY`)} and updated{` `}
{moment(frontmatter.updated).format(`D MMM YYYY`)}
</em>
</p>
</div>
published = (
<em>
{`originally published `}
{moment(frontmatter.written).format(`D MMM YYYY`)}
{` and updated `}
{moment(frontmatter.updated).format(`D MMM YYYY`)}
</em>
)
}

return <div className="container content">{published}</div>
return (
<div className="container content">
<div className="date-published">
<p>{published}</p>
</div>
</div>
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import SiteLinks from "../SiteLinks"

class SiteSidebar extends React.Component {
render() {
const isHome = this.props.location.pathname === `/`
const { siteMetadata } = this.props.data.site
// TODO, deal with image more nice like

Expand All @@ -14,7 +13,10 @@ class SiteSidebar extends React.Component {
<div className="card-image">
<Link to={`/`}>
<figure className="image">
<img src="https://camo.githubusercontent.com/ac31ac54c2013850b0fb8a3a4926f4718a398fb3/68747470733a2f2f7777772e6761747362796a732e6f72672f6d6f6e6f6772616d2e737667" />
<img
src="https://camo.githubusercontent.com/ac31ac54c2013850b0fb8a3a4926f4718a398fb3/68747470733a2f2f7777772e6761747362796a732e6f72672f6d6f6e6f6772616d2e737667"
alt="Gatsby logo"
/>
</figure>
</Link>
</div>
Expand Down
2 changes: 0 additions & 2 deletions examples/using-javascript-transforms/src/mainPages/contact.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from "react"
import Helmet from "react-helmet"
import SiteLinks from "../components/SiteLinks"
import InsetPageLayout from "../components/Layouts/insetPage"

export const frontmatter = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import { Link } from "gatsby"
import Helmet from "react-helmet"
import sortBy from "lodash/sortBy"
import moment from "moment"
import InsetPageLayout from "../components/Layouts/insetPage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react"
import moment from "moment"
import BlogPostChrome from "../components/BlogPostChrome"

class mdBlogPost extends React.Component {
render() {
const { html, frontmatter } = this.props.data.markdownRemark
const { html } = this.props.data.markdownRemark

return (
<BlogPostChrome
Expand Down

0 comments on commit 69ebadc

Please sign in to comment.