Skip to content

Commit

Permalink
chore(lint): fix unicorn/explicit-length-check
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 2, 2023
1 parent e3601f2 commit 0dbde70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ module.exports = {
'unicorn/catch-error-name': 'off',
'unicorn/consistent-destructuring': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'unicorn/no-array-callback-reference': 'off',
Expand Down
6 changes: 3 additions & 3 deletions src/events/http/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export default class HttpServer {
request.payload.length > 1
) {
try {
if (!request.payload || request.payload.length < 1) {
if (!request.payload || request.payload.length === 0) {
request.payload = '{}'
}

Expand Down Expand Up @@ -748,7 +748,7 @@ export default class HttpServer {
const { responseTemplates } = chosenResponse

if (typeof responseTemplates === 'object') {
if (keys(responseTemplates).length) {
if (keys(responseTemplates).length > 0) {
// BAD IMPLEMENTATION: first key in responseTemplates
const responseTemplate = responseTemplates[responseContentType]

Expand Down Expand Up @@ -1137,7 +1137,7 @@ export default class HttpServer {

const resourceRoutes = parseResources(this.#serverless.service.resources)

if (!resourceRoutes || !keys(resourceRoutes).length) {
if (!resourceRoutes || keys(resourceRoutes).length === 0) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/events/http/createJWTAuthScheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function createAuthScheme(jwtOptions) {
}

let scopes = null
if (jwtOptions.scopes && jwtOptions.scopes.length) {
if (jwtOptions.scopes && jwtOptions.scopes.length > 0) {
if (!scope) {
log.notice(`JWT Token missing valid scope`)

Expand Down

0 comments on commit 0dbde70

Please sign in to comment.