Skip to content

Commit

Permalink
fixes linting
Browse files Browse the repository at this point in the history
  • Loading branch information
minaorangina committed Dec 29, 2016
1 parent 6d0a8b2 commit 2449349
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 27 deletions.
23 changes: 19 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"parser": "babel-eslint",
"plugins": ["react"],
"plugins": ["react", "import"],
"extends": [
"plugin:import/errors",
"plugin:import/warnings",
"eslint:recommended",
"plugin:react/recommended"
],
"env": {
"node": true
"node": true,
"es6": true,
"browser": true,
"mocha": true
},
"ecmaFeatures": {
"jsx": true
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
},
"globals": {
"window": true,
"document": true
},
"rules": {
"no-console": ["warn", {allow: ["warn","error"]}],
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"version": "1.0.0",
"description": "Run or walk for your transport?",
"main": "./server/start.js",
"engines": {
"node": "6.1.9"
},
"scripts": {
"start": "node ./server/start.js",
"start:dev": "nodemon ./server/start.js",
"dev": "node ./src/utils/dev-server.js",
"postinstall": "webpack --config ./webpack.production.config.js",
"build": "webpack --config webpack.dev.config.js",
"lint": "eslint src/**/*.js server/**/*.js test/**/*.js",
"test": "tape --require babel-register --require ignore-styles --require ./test/utils/test_helpers.js 'test/tape/**/*.es6'",
"test:mocha": "node_modules/mocha/bin/mocha --compilers js:babel-core/register --require ./test/utils/test_helpers.js 'test/unit/**/*.@(js|jsx)'"
},
Expand Down Expand Up @@ -54,10 +58,12 @@
"babel-eslint": "^7.0.0",
"chai": "^3.5.0",
"eslint": "^3.8.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^6.4.1",
"jsdom": "^9.8.0",
"mocha": "^3.1.2",
"react-addons-test-utils": "^15.3.2",
"tap-spec": "^4.1.1",
"webpack-dev-server": "^1.16.2"
}
}
13 changes: 1 addition & 12 deletions test/unit/app-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

import React from 'react';
import { renderIntoDocument } from 'react-addons-test-utils';
import { scryRenderedDOMComponentsWithTag } from 'react-addons-test-utils';
import { scryRenderedDOMComponentsWithClass } from 'react-addons-test-utils';

import { expect } from 'chai';
import shallowRenderer from '../utils/shallowRenderer.js';

import AppContainer from '../../public/src/components/app-container.jsx';
import DirectionButtons from '../../public/src/components/direction-buttons.jsx';
import AppContainer from '../../src/js/containers/app.jsx';


describe('AppContainer', function () {
Expand All @@ -27,11 +23,4 @@ describe('AppContainer', function () {

expect(_ArrivalsContainer.length).to.equal(1);
});

it('renders DirectionButtons correctly', function () {

const _directionButtons = shallowRenderer(<DirectionButtons />);

expect(_directionButtons.props.children.length).to.equal(2);
});
});
12 changes: 5 additions & 7 deletions test/unit/arrivals.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
'use strict';

import React from 'react';
import { renderIntoDocument } from 'react-addons-test-utils';
import { scryRenderedDOMComponentsWithTag } from 'react-addons-test-utils';
import { scryRenderedDOMComponentsWithClass } from 'react-addons-test-utils';
import {
renderIntoDocument,
scryRenderedDOMComponentsWithClass
} from 'react-addons-test-utils';

import { expect } from 'chai';
import shallowRenderer from '../utils/shallowRenderer.js';

import AppContainer from '../../public/src/components/app-container.jsx';
import DirectionButtons from '../../public/src/components/direction-buttons.jsx';
import AppContainer from '../../src/js/containers/app.jsx';


describe('AppContainer', function () {
Expand Down
1 change: 0 additions & 1 deletion test/utils/shallowRenderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

import React from 'react';
import { createRenderer } from 'react-addons-test-utils';

export default function shallowRenderer (component) {
Expand Down
3 changes: 0 additions & 3 deletions test/utils/test_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import jsdom from 'jsdom';
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');
const win = doc.defaultView;

function doNothing () {
return null;
}

// require('ignore-styles');

Expand Down

0 comments on commit 2449349

Please sign in to comment.