Skip to content

Commit 9e99c17

Browse files
committed
Merge pull request #55 from ipeters90/configure-lint-script
fixed eslint errs and added npm lint script
2 parents fcf7598 + b821b8b commit 9e99c17

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
],
1010
"scripts": {
1111
"build": "babel src --out-dir lib",
12-
"prepublish": "rimraf lib && npm run build",
13-
"test": "mocha --compilers js:babel-core/register --reporter spec test/*.js"
12+
"prepublish": "npm run test && rimraf lib && npm run build",
13+
"test": "mocha --compilers js:babel-core/register --reporter spec test/*.js",
14+
"posttest": "npm run lint",
15+
"lint": "eslint src test"
1416
},
1517
"repository": {
1618
"type": "git",
@@ -37,6 +39,7 @@
3739
"chai": "^3.2.0",
3840
"eslint": "^1.10.2",
3941
"eslint-config-airbnb": "1.0.2",
42+
"eslint-plugin-react": "^4.1.0",
4043
"mocha": "^2.2.5",
4144
"rimraf": "^2.4.3"
4245
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ function thunkMiddleware({ dispatch, getState }) {
55
next(action);
66
}
77

8-
module.exports = thunkMiddleware
8+
module.exports = thunkMiddleware;

test/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ describe('thunk middleware', () => {
4545
const expected = 'redux';
4646
const actionHandler = nextHandler(() => expected);
4747

48-
let outcome = actionHandler();
48+
const outcome = actionHandler();
4949
chai.assert.strictEqual(outcome, expected);
5050
});
5151

5252
it('must return value as expected if a function', () => {
5353
const expected = 'rocks';
5454
const actionHandler = nextHandler();
5555

56-
let outcome = actionHandler(() => expected);
56+
const outcome = actionHandler(() => expected);
5757
chai.assert.strictEqual(outcome, expected);
5858
});
5959

@@ -71,7 +71,7 @@ describe('thunk middleware', () => {
7171
it('must throw if argument is non-object', done => {
7272
try {
7373
thunkMiddleware();
74-
} catch(err) {
74+
} catch (err) {
7575
done();
7676
}
7777
});

0 commit comments

Comments
 (0)