Permalink
Browse files

lint: add editorconfig and eslint to enforce

  • Loading branch information...
dougwilson committed Sep 9, 2017
1 parent 5010822 commit 863b9d719a8b61e93cad5496efc686ddb289ca40
Showing with 26 additions and 2 deletions.
  1. +11 −0 .editorconfig
  2. +3 −0 .eslintignore
  3. +7 −0 .eslintrc
  4. +1 −0 .travis.yml
  5. +2 −0 package.json
  6. +2 −2 test/mounting.js
View
@@ -0,0 +1,11 @@
# 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
View
@@ -0,0 +1,3 @@
.nyc_output
coverage
node_modules
View
@@ -0,0 +1,7 @@
{
"rules": {
"eol-last": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-trailing-spaces": "error"
}
}
View
@@ -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"
View
@@ -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"
View
@@ -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)

0 comments on commit 863b9d7

Please sign in to comment.