Skip to content
Myr

lint: add eslint rules that cover editorconfig

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 713d2ae · Browse files · 18 files+34 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

18 files+34 added−20 removed

  • tests:+11 added−11 removed
  • other:+23 added−9 removed

18 files+34 added−20 removed

modified:examples/content-negotiation/db.js+1 added-1 removed
modified:examples/mvc/controllers/main/index.js+1 added-1 removed
modified:examples/mvc/db.js+1 added-1 removed
modified:examples/resource/index.js+1 added-1 removed
modified:examples/route-separation/site.js+1 added-1 removed
modified:examples/search/public/client.js+1 added-1 removed
modified:examples/static-files/public/js/app.js+1 added-1 removed
modified:examples/web-service/index.js+1 added-1 removed
59 unmodified lines
60 , { name: 'jane' }61];6263var userRepos = {64 tobi: [repos[0], repos[1]]64 tobi: [repos[0], repos[1]]65 , loki: [repos[1]]66 , jane: [repos[2]]67};68
44 unmodified lines
modified:test/acceptance/error-pages.js+1 added-1 removed
97 unmodified lines
98 .expect(500, done)99 })100 })101 })102})102})
modified:test/acceptance/error.js+1 added-1 removed
24 unmodified lines
25 .get('/missing')26 .expect(404,done)27 })28 })29})29})
modified:test/acceptance/route-map.js+1 added-1 removed
40 unmodified lines
41 .del('/users/12/pets/2')42 .expect('delete 12\'s pet 2', done);43 })44 })45})45})
modified:test/app.engine.js+2 added-2 removed
45 unmodified lines
46 str.should.equal('<p>tobi</p>');47 done();48 })49 })50 5051 it('should work "view engine" setting', function(done){52 var app = express();5354 app.set('views', path.join(__dirname, 'fixtures'))
6 unmodified lines
61 str.should.equal('<p>tobi</p>');62 done();63 })64 })65 6566 it('should work "view engine" with leading "."', function(done){67 var app = express();6869 app.set('views', path.join(__dirname, 'fixtures'))
12 unmodified lines
modified:test/config.js+6 added-6 removed
47 unmodified lines
48 it('should return undefined when unset', function(){49 var app = express();50 assert.strictEqual(app.get('foo'), undefined);51 })52 5253 it('should otherwise return the value', function(){54 var app = express();55 app.set('foo', 'bar');56 assert.equal(app.get('foo'), 'bar');
67 unmodified lines
124 assert.equal(app.enable('tobi'), app);125 assert.strictEqual(app.get('tobi'), true);126 })127 })128 128129 describe('.disable()', function(){130 it('should set the value to false', function(){131 var app = express();132 assert.equal(app.disable('tobi'), app);133 assert.strictEqual(app.get('tobi'), false);134 })135 })136 136137 describe('.enabled()', function(){138 it('should default to false', function(){139 var app = express();140 assert.strictEqual(app.enabled('foo'), false);141 })142 142143 it('should return true when set', function(){144 var app = express();145 app.set('foo', 'bar');146 assert.strictEqual(app.enabled('foo'), true);147 })148 })149 149150 describe('.disabled()', function(){151 it('should default to true', function(){152 var app = express();153 assert.strictEqual(app.disabled('foo'), true);154 })155 155156 it('should return false when set', function(){157 var app = express();158 app.set('foo', 'bar');159 assert.strictEqual(app.disabled('foo'), false);
3 unmodified lines
added:.eslintignore+2 added
1coverage2node_modules
added:.eslintrc+7 added
1{2 "rules": {3 "eol-last": "error",4 "indent": ["error", 2, { "SwitchCase": 1 }],5 "no-trailing-spaces": "error"6 }7}
modified:.travis.yml+3 added-1 removed
25 unmodified lines
2627 # Update Node.js modules28 - "test ! -d node_modules || npm prune"29 - "test ! -d node_modules || npm rebuild"30script: "npm run-script test-ci"30script:31 - "npm run test-ci"32 - "npm run lint"33after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
modified:appveyor.yml+1 added
20 unmodified lines
21test_script:22 - node --version23 - npm --version24 - npm run test-ci25 - npm run lint26version: "{build}"
modified:package.json+2 added
59 unmodified lines
60 "after": "0.8.2",61 "body-parser": "1.17.2",62 "cookie-parser": "~1.4.3",63 "ejs": "2.5.7",64 "eslint": "2.13.1",65 "express-session": "1.15.3",66 "hbs": "4.0.1",67 "istanbul": "0.4.5",68 "marked": "0.3.6",
18 unmodified lines
87 "index.js",88 "lib/"89 ],90 "scripts": {91 "lint": "eslint .",92 "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",93 "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",94 "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",95 "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
2 unmodified lines