Permalink
Browse files

Better linting

  • Loading branch information...
tannerlinsley committed Jul 16, 2018
1 parent 6ed290b commit 59ef6b7d93d19bae17cfc0343450cd7e504427f2
@@ -3,4 +3,8 @@ module.exports = {
env: {
jest: true,
},
rules: {
'import/no-unresolved': 0,
'import/extensions': 0,
},
}
@@ -11,7 +11,8 @@ import { connect } from 'react-redux'
const Person = ({ data: { loading, error, Fake } }) => {
if (loading) {
return <p>Loading...</p>
} else if (error) {
}
if (error) {
return <p>Error!</p>
}
return (
@@ -10,7 +10,8 @@ import gql from 'graphql-tag'
const Person = ({ data: { loading, error, Fake } }) => {
if (loading) {
return <p>Loading...</p>
} else if (error) {
}
if (error) {
return <p>Error!</p>
}
return (
@@ -6,6 +6,7 @@ export default class MyLocation extends Component {
state = {
startingLocation: {},
}

async componentWillMount() {
// get current position
const startingLocation = await Geolocation.getCurrentPosition()
@@ -24,10 +25,12 @@ export default class MyLocation extends Component {
}
)
}

componentWillUnmount() {
// to stop watching
if (this.stopWatching) this.stopWatching()
}

render() {
const { startingLocation, currentLocation } = this.state
return (
@@ -78,6 +78,7 @@ class App extends React.Component {
}
})
}

render() {
return (
<Router>
@@ -8,6 +8,7 @@ class ClickOutside extends PureComponent {
this.props.onClickOutside()
}
}

render() {
return this.props.children
}
@@ -167,10 +167,12 @@ class Sidebar extends React.Component {
state = {
isOpen: false,
}

toggle = isOpen =>
this.setState({
isOpen,
})

render() {
const { children } = this.props
const { isOpen } = this.state
@@ -17,6 +17,7 @@ class VehicleCard extends React.Component {
static propTypes = {
product: PropTypes.object.isRequired,
}

render() {
const vehicle = this.props.product
return (
@@ -11,7 +11,6 @@ import postcssFlexbugsFixes from 'postcss-flexbugs-fixes'
/*
* For TypeScript Support
* */
const typescriptWebpackPaths = require('./webpack.config.js')

const path = require('path')
const fs = require('fs')
@@ -23,6 +22,7 @@ const themeVariables = lessToJs(
)

const webpack = require('webpack')
const typescriptWebpackPaths = require('./webpack.config.js')

//
export default {
@@ -13,16 +13,19 @@ export default class extends React.Component {
state = {
ready: false,
}

componentDidMount() {
this.makeReady()
}

makeReady = () => {
if (!this.state.ready) {
this.setState({
ready: true,
})
}
}

render() {
return this.state.ready ? (
<div>
@@ -12,7 +12,7 @@
"dependencies": {
"axios": "^0.16.2",
"node-sass": "^4.7.2",
"react-static": "next",
"react-static": "^6.0.0-beta.15",
"sass-loader": "^6.0.6"
},
"devDependencies": {
@@ -25,7 +25,7 @@
"prettier": "prettier --config .prettierrc.js {examples/*/src,node,scripts,src,www/src}/**/*.js --write",
"serveDocs": "serve www/dist -p 3000",
"test": "yarn build && yarn unitTest && yarn lint",
"lint": "eslint src examples test",
"lint": "eslint src test && yarn prettier",
"unitTest": "NODE_ENV=test yarn jest src",
"unitTestWatch": "NODE_ENV=test yarn jest src --watch",
"test-sample-build": "yarn link && cd examples/basic && yarn && yarn link react-static && yarn build"
@@ -52,17 +52,19 @@
"babel-plugin-universal-import": "^3.0.0",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "^2.4.1",
"chokidar": "^2.0.4",
"circular-dependency-plugin": "^5.0.2",
"commander": "^2.16.0",
"cors": "^2.8.4",
"css-loader": "^1.0.0",
"download-git-repo": "^1.0.2",
"eslint-config-react-tools": "^2.0.0",
"eslint-config-react-tools": "^1.0.0",
"extract-css-chunks-webpack-plugin": "^3.0.7",
"file-loader": "^1.1.11",
"fs-extra": "^6.0.1",
"git-promise": "^0.3.1",
"glob": "^7.1.2",
"history": "^4.7.2",
"html-webpack-plugin": "^3.2.0",
"inquirer": "^6.0.0",
"inquirer-autocomplete-prompt": "^0.12.2",
@@ -94,6 +96,7 @@
"socket.io-client": "^2.1.1",
"style-loader": "^0.21.0",
"swimmer": "^1.3.1",
"uglifyjs-webpack-plugin": "^1.2.7",
"update-notifier": "^2.5.0",
"url-loader": "^1.0.1",
"webpack": "^4.8.0",
@@ -108,7 +111,12 @@
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"eslint": "^5.1.0",
"eslint": "4",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.10.0",
"husky": "^1.0.0-rc.13",
"jest": "^23.4.1",
"prettier": "1.13.7",
@@ -8,13 +8,15 @@ export default class Loading extends React.Component {
state = {
loading,
}

componentWillMount() {
this.unsubscribe = onLoading(loading =>
this.setState({
loading,
})
)
}

render() {
const { component, render, children, ...rest } = this.props
const finalProps = {
@@ -1,10 +1,9 @@
import React from 'react'
//
import logoImg from '../logo.png'

export default () => (
<div>
<h1 style={{ textAlign: 'center' }}>Welcome to</h1>
<img src={logoImg} alt="" style={{ display: 'block', margin: '0 auto' }} />
<img src="" alt="" style={{ display: 'block', margin: '0 auto' }} />
</div>
)
@@ -8,7 +8,7 @@ import nodePath from 'path'
import fs from 'fs-extra'

import Redirect from '../client/components/Redirect'
import { getConfigPluginHooks } from '../utils/'
import { getConfigPluginHooks } from '../utils'
import { makePathAbsolute } from '../utils/shared'

import { makeHtmlWithMeta } from './components/HtmlWithMeta'
@@ -16,7 +16,7 @@ import {
getConfigPluginHooks,
} from '../../utils'
import { cleanPath } from '../../utils/shared'
import { prepareRoutes } from '../'
import { prepareRoutes } from ".."

let resolvedReloadRoutes
let reloadWebpackRoutes
@@ -1,8 +1,8 @@
require('@babel/register')

const updateNotifier = require('update-notifier')
const pkg = require('../../package.json')
const PrettyError = require('pretty-error')
const pkg = require('../../package.json')

updateNotifier({ pkg }).notify({
isGlobal: false,
Oops, something went wrong.

0 comments on commit 59ef6b7

Please sign in to comment.