Skip to content

Commit

Permalink
- Linting; Avoid need for settings with new ash-nazg defaults; disabl…
Browse files Browse the repository at this point in the history
…e require-jsdoc for tests; use new preference for "object" over "Object"

- npm: Update devDeps
  • Loading branch information
brettz9 committed May 27, 2019
1 parent 53e0ec3 commit fa997d8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 37 deletions.
8 changes: 1 addition & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ module.exports = {
// Override ash-nazg's current preference for ESM
'plugin:node/recommended-script'
],
settings: {
jsdoc: {
// For `jsdoc/check-examples` in `ash-nazg`
matchingFileName: 'dummy.md',
rejectExampleCodeRegex: '^`',
}
},
overrides: [
{
files: ['test/**'],
Expand All @@ -26,6 +19,7 @@ module.exports = {
expect: 'readonly'
},
rules: {
'jsdoc/require-jsdoc': 'off'
// 'jest/no-disabled-tests': [2],
// 'jest/no-focused-tests': [2],
// 'jest/no-identical-title': [2],
Expand Down
11 changes: 7 additions & 4 deletions lib/authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Authenticator {
*
* passport.framework(require('hapi-passport')());
*
* @param {Object} fw
* @param {object} fw
* @returns {Authenticator} for chaining
* @public
*/
Expand Down Expand Up @@ -167,7 +167,7 @@ class Authenticator {
* });
*
* @param {string} strategy
* @param {Object} options
* @param {object} options
* @param {Function} callback
* @returns {Function} middleware
* @public
Expand All @@ -192,7 +192,7 @@ class Authenticator {
* passport.authorize('twitter-authz', { failureRedirect: '/account' });
*
* @param {string} strategy
* @param {Object} options
* @param {object} options
* @param {Function} callback
* @returns {Function} middleware
* @public
Expand Down Expand Up @@ -230,7 +230,7 @@ class Authenticator {
* app.use(passport.initialize());
* app.use(passport.session());
*
* @param {Object} options
* @param {object} options
* @returns {Function} middleware
* @public
*/
Expand Down Expand Up @@ -297,6 +297,7 @@ class Authenticator {
}


// eslint-disable-next-line jsdoc/require-jsdoc
function serialized(e, o) {
pass(i + 1, e, o);
}
Expand Down Expand Up @@ -363,6 +364,7 @@ class Authenticator {
}


// eslint-disable-next-line jsdoc/require-jsdoc
function deserialized(e, u) {
pass(i + 1, e, u);
}
Expand Down Expand Up @@ -453,6 +455,7 @@ class Authenticator {
}


// eslint-disable-next-line jsdoc/require-jsdoc
function transformed(e, t) {
pass(i + 1, e, t);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/middleware/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const AuthenticationError = require('../errors/authenticationerror');
*
* @param {Authenticator} passport
* @param {string|Array} name
* @param {Object} options
* @param {object} options
* @param {Function} callback
* @returns {Function}
* @public
Expand Down Expand Up @@ -98,14 +98,15 @@ module.exports = function authenticate(passport, name, options, callback) {
// accumulator for failures from each strategy in the chain
const failures = [];

// eslint-disable-next-line jsdoc/require-jsdoc
function redirect(url) {
if (req.session && req.session.save && typeof req.session.save === 'function') {
return req.session.save(() => res.redirect(url));
}
return res.redirect(url);
}

// eslint-disable-next-line consistent-return
// eslint-disable-next-line consistent-return, jsdoc/require-jsdoc
function allFailed() {
if (callback) {
if (!multi) {
Expand Down Expand Up @@ -254,7 +255,7 @@ module.exports = function authenticate(passport, name, options, callback) {
req.logIn(user, options, (err) => {
if (err) { return next(err); }

// eslint-disable-next-line consistent-return
// eslint-disable-next-line consistent-return, jsdoc/require-jsdoc
function complete() {
if (options.successReturnToOrRedirect) {
let url = options.successReturnToOrRedirect;
Expand Down
45 changes: 27 additions & 18 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"homepage": "https://github.com/passport-next/passport",
"license": "MIT",
"main": "./lib",
"browserslist": ["node >= 8.0.0"],
"browserslist": [
"node >= 8.0.0"
],
"dependencies": {
"@passport-next/passport-strategy": "1.x.x"
},
Expand All @@ -37,15 +39,15 @@
"chai-connect-middleware": "0.x.x",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "13.x.x",
"eslint-config-ash-nazg": "^4.0.0",
"eslint-config-ash-nazg": "^6.0.1",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-compat": "^3.1.1",
"eslint-plugin-eslint-comments": "^3.1.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsdoc": "^4.8.3",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsdoc": "^7.0.2",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-no-use-extend-native": "^0.4.0",
"eslint-plugin-node": "^9.0.1",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-unicorn": "^8.0.2",
Expand Down

0 comments on commit fa997d8

Please sign in to comment.