Skip to content

Commit

Permalink
fix(chore): Properly configure and run code linter (#1092)
Browse files Browse the repository at this point in the history
* Properly configure and run code linter

* Move coverage exclude patterns to nyc configuration

* Do not delete exclude patterns from CodeClimate
  • Loading branch information
daffl authored Nov 16, 2018
1 parent e894ac8 commit fd3fc34
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 114 deletions.
10 changes: 5 additions & 5 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ plugins:
enabled: true
config:
count_threshold: 3
exclude_patterns:
- "**/test/*"
- "**/dist/*"
- "**/*.dist.js"
- "**/templates/*"
exclude_patterns:
- "**/test/*"
- "**/dist/*"
- "**/*.dist.js"
- "**/templates/*"
6 changes: 6 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"mocha"
]
},
"exclude": [
"**/test/*",
"**/dist/*",
"**/*.dist.js",
"**/templates/*"
],
"print": "detail",
"reporter": [
"html",
Expand Down
113 changes: 15 additions & 98 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"install": "lerna bootstrap",
"publish": "lerna publish",
"lint": "semistandard packages/**/*.js --fix",
"lint": "semistandard \"packages/**/lib/**/*.js\" \"packages/**/test/**/*.js\" --fix",
"test": "npm run lint && nyc lerna run test",
"test:client": "grunt"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/authentication-jwt/lib/verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class JWTVerifier {
const newPayload = { [`${this.options.entity}Id`]: id };
return done(null, entity, newPayload);
})
.catch(error => {
debug(`Error populating ${this.options.entity} with id ${id}`, error);
return done(error);
});
.catch(error => {
debug(`Error populating ${this.options.entity} with id ${id}`, error);
return done(error);
});
}
}

Expand Down
6 changes: 2 additions & 4 deletions packages/authentication-jwt/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ describe('@feathersjs/authentication-jwt', () => {
app = expressify(feathers());
app.use('/users', memory());
app.configure(authentication({
secret: sinon.spy(function(request, token, done) {
done(null, 'supersecret');
secret: sinon.spy(function (request, token, done) {
done(null, 'supersecret');
}),
cookie: {
enabled: true,
Expand Down Expand Up @@ -346,14 +346,12 @@ describe('@feathersjs/authentication-jwt', () => {
});

describe('passport strategy options', () => {
let authOptions;
let args;

beforeEach(() => {
sinon.spy(passportJWT, 'Strategy');
app.configure(jwt({ custom: true }));
app.setup();
authOptions = app.get('authentication');
args = passportJWT.Strategy.getCall(0).args[0];
});

Expand Down
1 change: 0 additions & 1 deletion packages/client/test/fixture.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require('path');
const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const rest = require('@feathersjs/express/rest');
Expand Down
2 changes: 1 addition & 1 deletion packages/express/test/rest/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('@feathersjs/express/rest provider', () => {
query: {},
provider: 'rest'
};

app.use('/hook-error', {
get () {
return Promise.reject(new Error('I blew up'));
Expand Down

0 comments on commit fd3fc34

Please sign in to comment.