Skip to content

Commit 7e4ebee

Browse files
committed
style: fix all eslint errors
1 parent 2a4e1ff commit 7e4ebee

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
"arrow-parens": [2, "as-needed"],
1515
"comma-dangle": ["error", "never"],
1616
"import/extensions": ["error", { "ts": "never" }],
17+
"class-methods-use-this": 0,
1718
"arrow-body-style": 0,
1819
"no-underscore-dangle": 0,
1920
"no-cond-assign": 0,
21+
"no-console": 0,
22+
"no-plusplus": 0,
2023
"linebreak-style": 0
2124
}
2225
}

hooks/expandAuthor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const expandAuthorHook = async (context: HookContext): Promise<HookContex
2525
};
2626

2727
export const expandAuthorManyHook = async (context: HookContext): Promise<HookContext> => {
28-
const polls = await bluebird.map(context.result, (poll: any) => expandAuthor(poll));
28+
const polls = await bluebird.map(context.result, (poll: PollSchema) => expandAuthor(poll));
2929
context.result = _.compact(polls);
3030
return context;
3131
};

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ db.once('open', () => {
1515
// Add any new real-time connection to the `everybody` channel
1616
app.on('connection', connection => app.channel('everybody').join(connection));
1717
// Publish all events to the `everybody` channel
18-
app.publish(data => app.channel('everybody'));
18+
app.publish(() => app.channel('everybody'));
1919

2020

2121
const port = 3030;

package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@feathersjs/feathers": "^4.5.3",
1515
"@feathersjs/socketio": "^4.5.4",
1616
"@feathersjs/transport-commons": "^4.5.3",
17+
"bluebird": "^3.7.2",
1718
"cors": "^2.8.5",
1819
"feathers-mongoose": "^8.3.0",
1920
"lodash": "^4.17.15",

populateDb.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ const createUser = (name: string): Promise<UserSchema> => {
5454
const populate = async () => {
5555
const users = await bluebird.map(names, name => createUser(name));
5656

57-
for (let i = 0; i < POLLS_AMOUNT; i++) {
57+
await bluebird.mapSeries(new Array(POLLS_AMOUNT), async () => {
5858
const sampleUser = _.sample(users);
59-
await createPoll(sampleUser?._id);
60-
}
59+
return createPoll(sampleUser?._id);
60+
});
6161
};
6262

6363
populate().finally(mongoose.disconnect);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Poll, PollSchema } from '../../models/polls/poll.schema';
1+
import { PollSchema } from '../../models/polls/poll.schema';
22
import PollModel from '../../models/polls/poll.model';
33

44
export default class Profiles {
5-
async get(id: string, params: any): Promise<PollSchema[]> {
6-
return PollModel.find({ authorId: id }).lean<Poll>();
5+
async get(id: string): Promise<PollSchema[]> {
6+
return PollModel.find({ authorId: id }).lean();
77
}
88
}
99

0 commit comments

Comments
 (0)