Skip to content

Commit 2fc3fa9

Browse files
committed
Fix some you-dont-need-lodash-underscore issues
1 parent 12b8960 commit 2fc3fa9

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

app/controllers/api/v1/GroupsController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class GroupsController {
5858
'isRestricted',
5959
]);
6060

61-
if (!_.isArray(ctx.request.body.admins)) {
61+
if (!Array.isArray(ctx.request.body.admins)) {
6262
throw new BadRequestException('"admins" should be an array of strings');
6363
}
6464

app/controllers/api/v2/EventsController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function getQueryParams(ctx) {
101101
const limit = parseInt(ctx.request.query.limit, 10) || DEFAULT_EVENTS_LIMIT;
102102
let eventGroups = ctx.request.query.filter || [];
103103

104-
if (!_.isArray(eventGroups)) {
104+
if (!Array.isArray(eventGroups)) {
105105
eventGroups = [eventGroups];
106106
}
107107

app/pubsub-listener.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Redis from 'ioredis';
22
import {
33
cloneDeep,
44
intersection,
5-
isArray,
65
isFunction,
76
isPlainObject,
87
keyBy,
@@ -135,7 +134,7 @@ export default class PubsubListener {
135134
}
136135

137136
const channelListsPromises = map(data, async (channelIds, channelType) => {
138-
if (!isArray(channelIds)) {
137+
if (!Array.isArray(channelIds)) {
139138
throw new EventHandlingError(`List of ${channelType} ids has to be an array`);
140139
}
141140

@@ -193,7 +192,7 @@ export default class PubsubListener {
193192
for (const channelType of Object.keys(data)) {
194193
const channelIds = data[channelType];
195194

196-
if (!isArray(channelIds)) {
195+
if (!Array.isArray(channelIds)) {
197196
throw new EventHandlingError(
198197
`List of ${channelType} ids has to be an array`,
199198
`got bogus channel list`,

eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ export default defineConfig([
116116
'you-dont-need-lodash-underscore/find': 'error',
117117
'you-dont-need-lodash-underscore/find-index': 'error',
118118
'you-dont-need-lodash-underscore/includes': 'error',
119+
'you-dont-need-lodash-underscore/uniq': 'off',
119120
'lodash/prefer-lodash-method': 'off',
120121
'lodash/prefer-lodash-typecheck': 'off',
121-
'lodash/import-scope': ['warn', 'member'],
122+
'lodash/import-scope': 'off', // TODO set to `['warn', 'member']`
122123
'lodash/prefer-constant': 'off',
123124
'lodash/prefer-noop': 'off',
124125
'lodash/prefer-lodash-chain': 'off',

test/functional/functional_test_helper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { readFile } from 'fs/promises';
66
import { basename } from 'path';
77

88
import request from 'superagent';
9-
// eslint-disable-next-line lodash/import-scope
109
import _, { merge } from 'lodash-es';
1110
import socketIO from 'socket.io-client';
1211
import expect from 'unexpected';

test/functional/privates.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* eslint-disable @typescript-eslint/no-unused-expressions */
33
/* global $pg_database */
44
import request from 'superagent';
5-
// eslint-disable-next-line lodash/import-scope
65
import * as _ from 'lodash-es';
76
import expect from 'unexpected';
87

0 commit comments

Comments
 (0)