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
Provenance
- Commit
56e90e3- Tree
d2744e9- Author
Douglas Christopher Wilson <doug@somethingdoug.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent
713d2ae
18 files changed+34 added−20 removed
modified:examples/content-negotiation/db.js+1 added-1 removed
2 unmodified lines3456772 unmodified linesusers.push({ name: 'Tobi' });users.push({ name: 'Loki' });users.push({ name: 'Jane' });
module.exports = users;No newline at end of filemodule.exports = users;modified:examples/mvc/controllers/main/index.js+1 added-1 removed
1233exports.index = function(req, res){ res.redirect('/users');};No newline at end of file};modified:examples/mvc/db.js+1 added-1 removed
9 unmodified lines1011121314149 unmodified linesvar users = exports.users = [];
users.push({ name: 'TJ', pets: [pets[0], pets[1], pets[2]], id: 0 });users.push({ name: 'Guillermo', pets: [pets[3]], id: 1 });users.push({ name: 'Nathan', pets: [], id: 2 });No newline at end of fileusers.push({ name: 'Nathan', pets: [], id: 2 });modified:examples/resource/index.js+1 added-1 removed
73 unmodified lines7475767778787980818211 unmodified lines73 unmodified linesapp.resource('/users', User);
app.get('/', function(req, res){ res.send([ '<h1>Examples:</h1> <ul>' '<h1>Examples:</h1> <ul>' , '<li>GET /users</li>' , '<li>GET /users/1</li>' , '<li>GET /users/3</li>' , '<li>GET /users/1..3</li>'11 unmodified linesmodified:examples/route-separation/site.js+1 added-1 removed
1233exports.index = function(req, res){ res.render('index', { title: 'Route Separation Example' });};No newline at end of file};modified:examples/search/public/client.js+1 added-1 removed
8 unmodified lines910111213138 unmodified lines code.textContent = xhr.responseText; } }; xhr.send();}, false);No newline at end of file}, false);modified:examples/static-files/public/js/app.js+1 added-1 removed
11fooNo newline at end of filefoomodified:examples/web-service/index.js+1 added-1 removed
59 unmodified lines60 , { name: 'jane' }61 ];62 63 var 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 linesmodified:test/acceptance/error-pages.js+1 added-1 removed
97 unmodified lines98 .expect(500, done)99 })100 })101 })102-})102+})modified:test/acceptance/error.js+1 added-1 removed
24 unmodified lines25 .get('/missing')26 .expect(404,done)27 })28 })29-})29+})modified:test/acceptance/route-map.js+1 added-1 removed
40 unmodified lines41 .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 lines46 str.should.equal('<p>tobi</p>');47 done();48 })49 })50- 50+51 it('should work "view engine" setting', function(done){52 var app = express();53 54 app.set('views', path.join(__dirname, 'fixtures'))6 unmodified lines61 str.should.equal('<p>tobi</p>');62 done();63 })64 })65- 65+66 it('should work "view engine" with leading "."', function(done){67 var app = express();68 69 app.set('views', path.join(__dirname, 'fixtures'))12 unmodified linesmodified:test/config.js+6 added-6 removed
47 unmodified lines48 it('should return undefined when unset', function(){49 var app = express();50 assert.strictEqual(app.get('foo'), undefined);51 })52- 52+53 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 lines124 assert.equal(app.enable('tobi'), app);125 assert.strictEqual(app.get('tobi'), true);126 })127 })128- 128+129 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- 136+137 describe('.enabled()', function(){138 it('should default to false', function(){139 var app = express();140 assert.strictEqual(app.enabled('foo'), false);141 })142- 142+143 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- 149+150 describe('.disabled()', function(){151 it('should default to true', function(){152 var app = express();153 assert.strictEqual(app.disabled('foo'), true);154 })155- 155+156 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 linesadded:.eslintignore+2 added
1+coverage2+node_modulesadded:.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 lines26 27 # Update Node.js modules28 - "test ! -d node_modules || npm prune"29 - "test ! -d node_modules || npm rebuild"30-script: "npm run-script test-ci"30+script:31+ - "npm run test-ci"32+ - "npm run lint"33 after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"modified:appveyor.yml+1 added
20 unmodified lines21 test_script:22 - node --version23 - npm --version24 - npm run test-ci25+ - npm run lint26 version: "{build}"modified:package.json+2 added
59 unmodified lines60 "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 lines87 "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