lint: add editorconfig and eslint to enforce

parent 50108221
# http://editorconfig.org
root = true
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[{*.js,*.json,*.yml}]
indent_size = 2
indent_style = space
.nyc_output
coverage
node_modules
{
"rules": {
"eol-last": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-trailing-spaces": "error"
}
}
......@@ -20,5 +20,6 @@ before_install:
- "test ! -d node_modules || npm rebuild"
script:
- "npm run-script test-travis"
- "npm run-script lint"
after_script:
- "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls"
......@@ -23,6 +23,7 @@
"utils-merge": "1.0.0"
},
"devDependencies": {
"eslint": "2.13.1",
"mocha": "3.5.0",
"nyc": "10.3.2",
"supertest": "2.0.0"
......@@ -38,6 +39,7 @@
"node": ">= 0.10.0"
},
"scripts": {
"lint": "eslint .",
"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/",
"test-cov": "nyc --reporter=text npm test",
"test-travis": "nyc --reporter=html --reporter=text npm test"
......
......@@ -171,12 +171,12 @@ describe('app.use()', function(){
it('should strip trailing slash', function(done){
var blog = connect();
blog.use(function(req, res){
assert.equal(req.url, '/');
res.end('blog');
});
app.use('/blog/', blog);
request(app)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment