Skip to content

Commit 2a4e1ff

Browse files
committed
style: fix some eslint errors
1 parent 755889e commit 2a4e1ff

File tree

11 files changed

+23
-27
lines changed

11 files changed

+23
-27
lines changed

index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
import app from './app';
21
import mongoose from 'mongoose';
32
import Promise from 'bluebird';
3+
import app from './app';
44

55
mongoose.Promise = Promise;
66

77
mongoose.connect('mongodb://localhost:27017/which', { useNewUrlParser: true });
88

99
const db = mongoose.connection;
1010
db.on('error', console.error.bind(console, 'connection error:'));
11-
db.once('open', function() {
11+
db.once('open', () => {
1212
console.log('Connection to MongoDB successful');
1313
});
1414

1515
// Add any new real-time connection to the `everybody` channel
16-
app.on('connection', connection =>
17-
app.channel('everybody').join(connection)
18-
);
16+
app.on('connection', connection => app.channel('everybody').join(connection));
1917
// Publish all events to the `everybody` channel
2018
app.publish(data => app.channel('everybody'));
2119

2220

23-
const port = 3030
24-
app.listen(port).on('listening', () =>
25-
console.log(`Feathers server listening on localhost:${port}`)
26-
);
21+
const port = 3030;
22+
app.listen(port).on('listening', () => console.log(`Feathers server listening on localhost:${port}`));
2723

models/polls/poll.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Model, model } from "mongoose"
1+
import { Model, model } from 'mongoose';
22
import { PollSchema, pollSchema } from './poll.schema';
33

4-
export default model<PollSchema, Model<PollSchema>>("Poll", pollSchema);
4+
export default model<PollSchema, Model<PollSchema>>('Poll', pollSchema);
55

models/polls/poll.schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Document, Schema, Types } from 'mongoose';
2-
import { User } from '../users/user.schema'
2+
import { User } from '../users/user.schema';
33

44
export interface ImageData {
55
url: string;
@@ -22,14 +22,14 @@ export interface PollSchema extends Document, Omit<Poll, 'author'> {
2222
const imageDataSchema = {
2323
url: String,
2424
votes: Number
25-
}
25+
};
2626

2727
export const pollSchema = new Schema({
2828
contents: {
2929
left: imageDataSchema,
3030
right: imageDataSchema
3131
},
32-
authorId: {
32+
authorId: {
3333
type: Types.ObjectId,
3434
ref: 'User'
3535
}

models/users/user.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Model, model } from "mongoose"
1+
import { Model, model } from 'mongoose';
22
import { UserSchema, userSchema } from './user.schema';
33

4-
export default model<UserSchema, Model<UserSchema>>("User", userSchema);
4+
export default model<UserSchema, Model<UserSchema>>('User', userSchema);
55

models/users/user.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Document, Schema } from "mongoose"
1+
import { Document, Schema } from 'mongoose';
22

33
export interface User {
44
name: string;

populateDb.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const createPoll = (authorId: string): Promise<PollSchema> => {
3737
return app.service('polls').create({
3838
contents: {
3939
left: generateImageData(),
40-
right: generateImageData(),
40+
right: generateImageData()
4141
},
4242
authorId
4343
});
@@ -57,7 +57,7 @@ const populate = async () => {
5757
for (let i = 0; i < POLLS_AMOUNT; i++) {
5858
const sampleUser = _.sample(users);
5959
await createPoll(sampleUser?._id);
60-
};
60+
}
6161
};
6262

6363
populate().finally(mongoose.disconnect);

services/polls/polls.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Application } from '@feathersjs/express';
2-
import Model from '../../models/polls/poll.model';
32
import service from 'feathers-mongoose';
4-
import hooks from './polls.hooks'
3+
import Model from '../../models/polls/poll.model';
4+
import hooks from './polls.hooks';
55

66
const PollService = service({ Model });
77

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Poll, PollSchema } from "../../models/polls/poll.schema";
1+
import { Poll, PollSchema } from '../../models/polls/poll.schema';
22
import PollModel from '../../models/polls/poll.model';
33

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2-
expandAuthorManyHook,
2+
expandAuthorManyHook
33
} from '../../hooks/expandAuthor';
44

55
export default {
66
after: {
7-
get: [expandAuthorManyHook],
7+
get: [expandAuthorManyHook]
88
}
99
};
1010

services/profiles/profiles.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Application } from "@feathersjs/express";
1+
import { Application } from '@feathersjs/express';
22
import Profiles from './profiles.class';
33

44
import hooks from './profiles.hooks';

0 commit comments

Comments
 (0)