Skip to content

Commit

Permalink
Use eslint instead of jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ridgway committed Mar 16, 2016
1 parent fb9dc18 commit 34d8cfa
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
artifacts
build
node_modules
10 changes: 10 additions & 0 deletions .eslintrc
@@ -0,0 +1,10 @@
---
env:
node: true
parser: "babel-eslint"
extend: "eslint:recommended"
rules:
indent: [2, 4, {SwitchCase: 1}]
quotes: [2, 'single']
dot-notation: [2, {allowKeywords: false}]

12 changes: 7 additions & 5 deletions package.json
Expand Up @@ -9,8 +9,8 @@
},
"scripts": {
"cover": "node node_modules/istanbul/lib/cli.js cover --dir artifacts -- ./node_modules/mocha/bin/_mocha tests/unit/ --recursive --reporter spec",
"lint": "./node_modules/.bin/jshint lib tests",
"test": "./node_modules/.bin/mocha tests/unit/ --recursive --compilers js:babel-register --require babel-polyfill --reporter spec"
"lint": "eslint .",
"test": "mocha tests/unit/ --recursive --compilers js:babel-register --require babel-polyfill --reporter spec"
},
"author": "Lingyan Zhu <lingyan@yahoo-inc.com",
"licenses": [
Expand All @@ -25,15 +25,17 @@
"query-string": "^3.0.1"
},
"devDependencies": {
"babel-eslint": "^5.0.0",
"babel-polyfill": "^6.7.2",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.7.2",
"chai": "^2.0.0",
"chai": "^3.2.0",
"coveralls": "^2.11.1",
"eslint": "~2.2.0",
"eslint-plugin-babel": "^3.1.0",
"istanbul": "^0.3.2",
"jshint": "^2.5.1",
"mocha": "^2.0.1",
"precommit-hook": "^2.0.1",
"pre-commit": "^1.0.7",
"sinon": "^1.17.3"
},
"jshintConfig": {
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/lib/router.js
Expand Up @@ -3,7 +3,7 @@
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,beforeEach,process */
"use strict";
'use strict';

var expect = require('chai').expect;
var Router = require('../../../lib/router');
Expand Down Expand Up @@ -174,22 +174,22 @@ describe('Router', function () {
expect(homeRoute.regexp).to.be.a('RegExp');
expect(function () {
frozen._routes.foo = 'abc';
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(function () {
homeRoute.name = 'unfreeze!';
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(function () {
homeRoute.config.method = 'unfreeze!';
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(function () {
homeRoute.config.page = 'unfreeze!';
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(function () {
homeRoute.keys[0] = 'unfreeze!';
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(function () {
homeRoute.config.regexp = null;
}).to.throw(TypeError);
}).to['throw'](TypeError);
expect(Object.keys(frozen._routes).length).to.equal(routesArray.length);
expect(frozen._routes.foo).to.equal(undefined);
expect(homeRoute.keys.length).to.equal(0);
Expand Down Expand Up @@ -390,7 +390,7 @@ describe('Router', function () {
path: '/'
}
]);
}).to.throw(Error);
}).to['throw'](Error);
});

it('should throw if there are routes with duplicate name', function () {
Expand All @@ -405,7 +405,7 @@ describe('Router', function () {
path: '/home'
}
]);
}).to.throw(Error);
}).to['throw'](Error);
});

it('should allow custom query string library', function () {
Expand Down

0 comments on commit 34d8cfa

Please sign in to comment.