Skip to content
This repository has been archived by the owner on Dec 31, 2018. It is now read-only.

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gyzerok committed Mar 18, 2016
1 parent 0426798 commit 4ab3cbe
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 58 deletions.
56 changes: 33 additions & 23 deletions .eslintrc
@@ -1,29 +1,25 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": "7",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"node": true
},
"globals": {
"__DEV__": false
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": false,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"jsx": true
"plugins": [
"react"
],
"extends": ["eslint:recommended"],
"settings": {
"react": {
"pragma": "React",
"version": "0.14.0"
}
},
"rules": {
"strict": [2, "never"],
Expand Down Expand Up @@ -138,11 +134,25 @@
"before": false,
"after": true
}],
"space-after-keywords": 2,
"keyword-spacing": 2,
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"spaced-comment": 2
"spaced-comment": 2,
// React rules
"react/display-name": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/no-danger": 2,
"react/no-deprecated": 2,
"react/no-did-mount-set-state": [2, 'allow-in-func'],
"react/no-did-update-set-state": [2, 'allow-in-func'],
"react/no-direct-mutation-state": 2,
"react/no-is-mounted": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/react-in-jsx-scope": 2
}
}
2 changes: 2 additions & 0 deletions example/index.js
@@ -1,3 +1,5 @@
/* eslint-disable */

global.__CLIENT__ = false;
require('babel/register')({
stage: 0,
Expand Down
2 changes: 0 additions & 2 deletions example/src/client/components/App.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component } from 'react';

export default class App extends Component {
Expand Down
2 changes: 0 additions & 2 deletions example/src/client/components/Loader.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component } from 'react';

export default class Loader extends Component {
Expand Down
2 changes: 2 additions & 0 deletions example/src/client/components/TodoApp.jsx
Expand Up @@ -11,6 +11,8 @@ import { createTodo } from '../mutations/todo';
class TodoApp extends Component {
static propTypes = {
viewer: PropTypes.object,
isFetching: PropTypes.bool.isRequired,
mutate: PropTypes.func.isRequired,
}

createTodo = (args) => {
Expand Down
2 changes: 0 additions & 2 deletions example/src/client/components/TodoInput.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component, PropTypes } from 'react';

const ENTER_KEY_CODE = 13;
Expand Down
2 changes: 0 additions & 2 deletions example/src/client/components/TodoItem.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import { presenter } from 'adrenaline';

Expand Down
2 changes: 0 additions & 2 deletions example/src/client/components/TodoList.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import { presenter } from 'adrenaline';

Expand Down
2 changes: 0 additions & 2 deletions example/src/client/index.js
@@ -1,5 +1,3 @@
/* @flow */

import 'whatwg-fetch';
import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
2 changes: 0 additions & 2 deletions example/src/client/routes.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React from 'react';
import { Route } from 'react-router';
import App from './components/App';
Expand Down
2 changes: 0 additions & 2 deletions example/src/server/schema.js
@@ -1,5 +1,3 @@
/* @flow */

import {
GraphQLObjectType,
GraphQLID,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -26,10 +26,11 @@
"devDependencies": {
"babel": "^5.8.23",
"babel-core": "^5.8.33",
"babel-eslint": "^4.1.6",
"babel-eslint": "^5.0.0",
"babel-loader": "^5.3.2",
"babel-runtime": "^5.8.25",
"eslint": "^1.9.0",
"eslint": "^2.4.0",
"eslint-plugin-react": "^4.2.3",
"expect": "^1.14.0",
"mocha": "^2.4.5",
"webpack": "^1.12.2"
Expand Down
2 changes: 0 additions & 2 deletions src/components/Adrenaline.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component, PropTypes } from 'react';

import performQuery from '../network/performQuery';
Expand Down
8 changes: 1 addition & 7 deletions src/components/container.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component, PropTypes } from 'react';
import invariant from 'invariant';

Expand Down Expand Up @@ -61,18 +59,14 @@ export default function container(specs) {
}
}

componentWillUnmount() {
//this.unsubscribe();
}

query = () => {
const { query } = specs;
const variables = mapPropsToVariables(this.props);

this.setState({ data: null }, () => {
this.context.query(query, variables)
.catch(err => {
console.err(err);
console.err(err); // eslint-disable-line
})
.then(data => this.setState({ data }));
});
Expand Down
2 changes: 0 additions & 2 deletions src/components/presenter.jsx
@@ -1,5 +1,3 @@
/* @flow */

import React, { Component } from 'react';
import invariant from 'invariant';

Expand Down
2 changes: 0 additions & 2 deletions src/index.js
@@ -1,5 +1,3 @@
/* @flow */

export Adrenaline from './components/Adrenaline';
export container from './components/container';
export presenter from './components/presenter';
Expand Down
2 changes: 1 addition & 1 deletion src/network/parseJSON.js
@@ -1,6 +1,6 @@
export default function parseJSON(res) {
if (res.status !== 200) {
throw 'Invalid request.'
throw new Error('Invalid request.');
}

return res.json().then(json => json.data);
Expand Down
2 changes: 1 addition & 1 deletion src/network/performMutation.js
Expand Up @@ -5,7 +5,7 @@ export default function performMutation(endpoint, mutation, variables, files) {
return fetch(endpoint, {
method: 'post',
headers: {
'Accept': 'application/json',
'Accept': 'application/json', // eslint-disable-line
'Content-Type': 'application/json',
},
credentials: 'same-origin',
Expand Down
2 changes: 1 addition & 1 deletion src/network/performQuery.js
Expand Up @@ -4,7 +4,7 @@ export default function performQuery(endpoint, query, variables) {
const opts = {
method: 'post',
headers: {
'Accept': 'application/json',
'Accept': 'application/json', //eslint-disable-line
'Content-Type': 'application/json',
},
credentials: 'same-origin',
Expand Down
1 change: 0 additions & 1 deletion src/test-utils/index.js
@@ -1,4 +1,3 @@
import expect from './expect';


export default { expect };

0 comments on commit 4ab3cbe

Please sign in to comment.