Skip to content
Permalink
Browse files

chore(prettier): change to 100 length and prettify existing files (#118)

  • Loading branch information...
goldcaddy77 committed Jun 13, 2019
1 parent fdb5df4 commit 670cc7c9e6c09eeac60f4728be9fcb6ce039d20b
@@ -0,0 +1 @@
**/generated/**/*
@@ -43,7 +43,10 @@ export class UserResolver extends BaseResolver<User> {

@Authorized('user:update')
@Mutation(returns => User)
async updateUser(@Args() { data, where }: UserUpdateArgs, @Ctx() ctx: BaseContext): Promise<User> {
async updateUser(
@Args() { data, where }: UserUpdateArgs,
@Ctx() ctx: BaseContext
): Promise<User> {
return this.update(data, where, ctx.user.id);
}

@@ -4,7 +4,13 @@ import { Repository } from 'typeorm';
import { InjectRepository } from 'typeorm-typedi-extensions';

import { BaseContext, BaseResolver, StandardDeleteResponse } from '../../../src';
import { PostCreateInput, PostUpdateArgs, PostWhereArgs, PostWhereInput, PostWhereUniqueInput } from '../generated';
import {
PostCreateInput,
PostUpdateArgs,
PostWhereArgs,
PostWhereInput,
PostWhereUniqueInput
} from '../generated';

import { Post } from './post.model';
import { User } from './user.model';
@@ -42,7 +48,10 @@ export class PostResolver extends BaseResolver<Post> {
}

@Mutation(returns => Post)
async updatePost(@Args() { data, where }: PostUpdateArgs, @Ctx() ctx: BaseContext): Promise<Post> {
async updatePost(
@Args() { data, where }: PostUpdateArgs,
@Ctx() ctx: BaseContext
): Promise<Post> {
return this.update(data, where, ctx.user.id);
}

@@ -4,7 +4,13 @@ import { Repository } from 'typeorm';
import { InjectRepository } from 'typeorm-typedi-extensions';

import { BaseContext, BaseResolver, StandardDeleteResponse } from '../../../src';
import { UserCreateInput, UserUpdateArgs, UserWhereArgs, UserWhereInput, UserWhereUniqueInput } from '../generated';
import {
UserCreateInput,
UserUpdateArgs,
UserWhereArgs,
UserWhereInput,
UserWhereUniqueInput
} from '../generated';

import { Post } from './post.model';
import { User } from './user.model';
@@ -42,7 +48,10 @@ export class UserResolver extends BaseResolver<User> {
}

@Mutation(returns => User)
async updateUser(@Args() { data, where }: UserUpdateArgs, @Ctx() ctx: BaseContext): Promise<User> {
async updateUser(
@Args() { data, where }: UserUpdateArgs,
@Ctx() ctx: BaseContext
): Promise<User> {
return this.update(data, where, ctx.user.id);
}

@@ -1,17 +1,35 @@
import { GraphQLResolveInfo } from 'graphql';
import { Arg, Args, ArgsType, Ctx, Field, FieldResolver, Mutation, Query, Resolver, Root } from 'type-graphql';
import {
Arg,
Args,
ArgsType,
Ctx,
Field,
FieldResolver,
Mutation,
Query,
Resolver,
Root
} from 'type-graphql';
import { Repository } from 'typeorm';
import { InjectRepository } from 'typeorm-typedi-extensions';

import { BaseContext, BaseResolver } from '../../../../src';
import { UserRoleCreateInput, UserRoleCreateManyArgs, UserRoleWhereArgs, UserRoleWhereInput } from '../../generated';
import {
UserRoleCreateInput,
UserRoleCreateManyArgs,
UserRoleWhereArgs,
UserRoleWhereInput
} from '../../generated';
import { Role } from './role.model';
import { UserRole } from './user-role.model';
import { User } from './user.model';

@Resolver(UserRole)
export class UserRoleResolver extends BaseResolver<UserRole> {
constructor(@InjectRepository(UserRole) public readonly userRoleRepository: Repository<UserRole>) {
constructor(
@InjectRepository(UserRole) public readonly userRoleRepository: Repository<UserRole>
) {
super(UserRole, userRoleRepository);
}

@@ -35,12 +53,18 @@ export class UserRoleResolver extends BaseResolver<UserRole> {
}

@Mutation(returns => UserRole)
async createUserRole(@Arg('data') data: UserRoleCreateInput, @Ctx() ctx: BaseContext): Promise<UserRole> {
async createUserRole(
@Arg('data') data: UserRoleCreateInput,
@Ctx() ctx: BaseContext
): Promise<UserRole> {
return this.create(data, ctx.user.id);
}

@Mutation(returns => [UserRole])
async createManyUserRoles(@Args() { data }: UserRoleCreateManyArgs, @Ctx() ctx: BaseContext): Promise<UserRole[]> {
async createManyUserRoles(
@Args() { data }: UserRoleCreateManyArgs,
@Ctx() ctx: BaseContext
): Promise<UserRole[]> {
return this.createMany(data, ctx.user.id);
}
}
@@ -14,7 +14,8 @@
"scripts": {
"build": "yarn tsc",
"lint": "tslint --fix -c ./tslint.json -p ./tsconfig.json",
"prettify": "prettier ./{src,test,tools,!generated}/**/*.ts --write",
"//prettier": "Note: ignores node_modules by default and 'generated' folder via .prettierignore",
"prettify": "yarn prettier './+(src|test|examples|tools)/**/*.ts' --write",
"semantic-release": "semantic-release",
"test": "jest --verbose --coverage",
"test:watch": "jest --verbose --watch",
@@ -106,7 +107,7 @@
"lint-staged": "^8.1.0",
"nodemon": "^1.18.9",
"npm-run-all": "^4.1.5",
"prettier": "^1.15.3",
"prettier": "^1.18.2",
"semantic-release": "^15.13.2",
"ts-jest": "^23.10.5",
"tslint": "^5.12.0",
@@ -138,7 +139,7 @@
"graphql-yoga/**/@types/graphql": "^14"
},
"prettier": {
"printWidth": 120,
"printWidth": 100,
"singleQuote": true
},
"jest": {
@@ -2949,7 +2949,7 @@ fsevents@^1.2.2, fsevents@^1.2.3:
node-pre-gyp "^0.10.0"

fstream@^1.0.0, fstream@^1.0.2:
version "1.0.12"
version "1.0.11"
resolved "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"
integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=
dependencies:
@@ -6427,10 +6427,10 @@ preserve@^0.2.0:
resolved "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=

prettier@^1.15.3:
version "1.15.3"
resolved "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a"
integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==
prettier@^1.18.2:
version "1.18.2"
resolved "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==

pretty-format@^23.6.0:
version "23.6.0"

0 comments on commit 670cc7c

Please sign in to comment.
You can’t perform that action at this time.