Fix linting errors
This commit is contained in:
parent
2987655479
commit
c923710ce2
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"extends": "loopback",
|
||||
"rules": {
|
||||
"max-len": ["error", 80, 4, {
|
||||
"max-len": ["error", 90, 4, {
|
||||
"ignoreComments": true,
|
||||
"ignoreUrls": true,
|
||||
"ignorePattern": "^\\s*var\\s.+=\\s*(require\\s*\\()|(/)"
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"lint": "eslint .",
|
||||
"test": "mocha",
|
||||
"posttest": "npm run lint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -17,6 +17,7 @@ $(function() {
|
|||
var accessToken;
|
||||
function loadSwaggerUi(config) {
|
||||
var methodOrder = ['get', 'head', 'options', 'put', 'post', 'delete'];
|
||||
/* eslint-disable camelcase */
|
||||
window.swaggerUi = new SwaggerUi({
|
||||
validatorUrl: null,
|
||||
url: config.url || '/swagger/resources',
|
||||
|
@ -58,6 +59,7 @@ $(function() {
|
|||
methodOrder.indexOf(a.method) - methodOrder.indexOf(b.method);
|
||||
},
|
||||
});
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
$('#explore').click(setAccessToken);
|
||||
$('#api_selector').submit(setAccessToken);
|
||||
|
@ -73,7 +75,8 @@ $(function() {
|
|||
log('key: ' + key);
|
||||
if (key && key.trim() !== '') {
|
||||
log('added accessToken ' + key);
|
||||
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization('access_token', key, 'query');
|
||||
var apiKeyAuth =
|
||||
new SwaggerClient.ApiKeyAuthorization('access_token', key, 'query');
|
||||
window.swaggerUi.api.clientAuthorizations.add('key', apiKeyAuth);
|
||||
accessToken = key;
|
||||
$('.accessTokenDisplay').text('Token Set.').addClass('set');
|
||||
|
@ -83,10 +86,9 @@ $(function() {
|
|||
if (window.localStorage) {
|
||||
window.localStorage.setItem(lsKey, key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If submitted with an empty token, remove the current token. Can be
|
||||
// useful to intentionally remove authorization.
|
||||
else {
|
||||
log('removed accessToken.');
|
||||
$('.accessTokenDisplay').text('Token Not Set.').removeClass('set');
|
||||
$('.accessTokenDisplay').removeAttr('data-tooltip');
|
||||
|
@ -116,5 +118,3 @@ $(function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ var urlJoin = require('../lib/url-join');
|
|||
var os = require('os');
|
||||
|
||||
describe('explorer', function() {
|
||||
|
||||
describe('with default config', function() {
|
||||
beforeEach(givenLoopBackAppWithExplorer());
|
||||
|
||||
|
|
Loading…
Reference in New Issue