Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Fix issues reported by ESLint via npm run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-kobrzak committed Aug 27, 2015
1 parent 0d64aa2 commit 75c6698
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
24 changes: 12 additions & 12 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ module.exports = function(config) {

webpack: {
module: {
preLoaders: [
{ test: /\.jsx?$/, loader: 'isparta', exclude: /\/(spec|node_modules)\// },
{ test: /\.jsx?$/, loader: 'eslint', exclude: /(node_modules)/ }
],
loaders: [
{ test: /\.jsx?$/, loader: 'babel', exclude: /(node_modules)/ },
{ test: /\.css$/, loaders: ['style', 'css'], exclude: /(node_modules)/ },
{ test: /\.scss$/, loaders: ['style', 'css', 'sass'], exclude: /(node_modules)/ }
]
}
preLoaders: [
{ test: /\.jsx?$/, loader: 'isparta', exclude: /\/(spec|node_modules)\// },
{ test: /\.jsx?$/, loader: 'eslint', exclude: /(node_modules)/ }
],
loaders: [
{ test: /\.jsx?$/, loader: 'babel', exclude: /(node_modules)/ },
{ test: /\.css$/, loaders: ['style', 'css'], exclude: /(node_modules)/ },
{ test: /\.scss$/, loaders: ['style', 'css', 'sass'], exclude: /(node_modules)/ }
]
}
},


Expand Down Expand Up @@ -80,5 +80,5 @@ module.exports = function(config) {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
})
}
});
};
16 changes: 8 additions & 8 deletions spec/section_spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'core-js/es5';
import React from 'react/addons';
import Section from '../src/book/section.jsx'
import Heading from '../src/book/heading.jsx'
import Description from '../src/book/description.jsx'
import Section from '../src/book/section.jsx'; // eslint-disable-line no-unused-vars
import Heading from '../src/book/heading.jsx';
import Description from '../src/book/description.jsx';

describe('Section', function() {
let sectionComponent;
Expand All @@ -15,25 +15,25 @@ describe('Section', function() {
sectionComponent = shallowRenderer.getRenderOutput();
});

it('is wrapped in <section> element',function() {
it('is wrapped in <section> element', function() {
expect( sectionComponent.type ).to.equal( 'section' );
});

describe('checks if children exist regardless of their order',function() {
describe('checks if children exist regardless of their order', function() {
let children;

before(function() {
children = sectionComponent.props.children;
});

it('includes Heading component',function() {
it('includes Heading component', function() {
let childHeading = children.filter(
component => component.type === Heading
);
expect( childHeading.length ).to.be.ok;
});

it('includes Description component',function() {
it('includes Description component', function() {
let childDescription = children.filter(
component => component.type === Description
);
Expand All @@ -42,7 +42,7 @@ describe('Section', function() {
});

// An alternative to the two tests above
it('includes Heading and Description components in particular order',function() {
it('includes Heading and Description components in particular order', function() {
expect( sectionComponent.props.children ).to.eql( [
<Heading />,
<Description />
Expand Down
6 changes: 3 additions & 3 deletions src/book/section.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Heading from './heading.jsx';
import Description from './description.jsx';
import Heading from './heading.jsx'; // eslint-disable-line no-unused-vars
import Description from './description.jsx'; // eslint-disable-line no-unused-vars

export default class extends React.Component {
render() {
Expand All @@ -9,6 +9,6 @@ export default class extends React.Component {
<Heading />
<Description />
</section>
)
);
}
}
8 changes: 4 additions & 4 deletions webpack-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ new WebpackDevServer(webpack(config), {
hot: true,
headers: { 'Access-Control-Allow-Origin': '*' },
historyApiFallback: true
}).listen(5000, 'localhost', function (err, result) {
if (err) {
console.log(err);
}).listen(5000, 'localhost', function(error) {
if (error) {
console.log(error);
}

console.log('Listening at localhost:5000');
});
});

0 comments on commit 75c6698

Please sign in to comment.