Skip to content

Commit d6c5404

Browse files
committed
fix: Fix lint errors by newer version of prettier
1 parent 0ab9de1 commit d6c5404

File tree

3 files changed

+63
-63
lines changed

3 files changed

+63
-63
lines changed

packages/repository/examples/repositories/customer-repository.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export class CustomerRepository extends CrudRepositoryImpl<Customer, string> {
1919
}
2020

2121
/**
22-
* Override deleteAll to disable the operation
23-
*/
22+
* Override deleteAll to disable the operation
23+
*/
2424
deleteAll(where?: Where, options?: Options) {
2525
return Promise.reject(new Error('deleteAll is disabled'));
2626
}

packages/repository/src/model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ModelDefinition {
8585
definitionOrType: PropertyDefinition | PropertyType,
8686
): this {
8787
const definition = (definitionOrType as PropertyDefinition).type
88-
? definitionOrType as PropertyDefinition
88+
? (definitionOrType as PropertyDefinition)
8989
: {type: definitionOrType};
9090
this.properties[name] = definition;
9191
return this;

packages/repository/src/repository-mixin.ts

+60-60
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import {Repository} from './repository';
99
// tslint:disable:no-any
1010

1111
/**
12-
* A mixin class for Application that creates a .repository()
13-
* function to register a repository automatically. Also overrides
14-
* component function to allow it to register repositories automatically.
15-
*
16-
* ```ts
17-
*
18-
* class MyApplication extends RepositoryMixin(Application) {}
19-
* ```
20-
*/
12+
* A mixin class for Application that creates a .repository()
13+
* function to register a repository automatically. Also overrides
14+
* component function to allow it to register repositories automatically.
15+
*
16+
* ```ts
17+
*
18+
* class MyApplication extends RepositoryMixin(Application) {}
19+
* ```
20+
*/
2121
export function RepositoryMixin<T extends Class<any>>(superClass: T) {
2222
return class extends superClass {
2323
// A mixin class has to take in a type any[] argument!
@@ -40,69 +40,69 @@ export function RepositoryMixin<T extends Class<any>>(superClass: T) {
4040
}
4141

4242
/**
43-
* Add a repository to this application.
44-
*
45-
* @param repo The repository to add.
46-
*
47-
* ```ts
48-
*
49-
* class NoteRepo {
50-
* model: any;
51-
*
52-
* constructor() {
53-
* const ds: juggler.DataSource = new DataSourceConstructor({
54-
* name: 'db',
55-
* connector: 'memory',
56-
* });
57-
*
58-
* this.model = ds.createModel(
59-
* 'note',
60-
* {title: 'string', content: 'string'},
61-
* {}
62-
* );
63-
* }
64-
* };
65-
*
66-
* app.repository(NoteRepo);
67-
* ```
68-
*/
43+
* Add a repository to this application.
44+
*
45+
* @param repo The repository to add.
46+
*
47+
* ```ts
48+
*
49+
* class NoteRepo {
50+
* model: any;
51+
*
52+
* constructor() {
53+
* const ds: juggler.DataSource = new DataSourceConstructor({
54+
* name: 'db',
55+
* connector: 'memory',
56+
* });
57+
*
58+
* this.model = ds.createModel(
59+
* 'note',
60+
* {title: 'string', content: 'string'},
61+
* {}
62+
* );
63+
* }
64+
* };
65+
*
66+
* app.repository(NoteRepo);
67+
* ```
68+
*/
6969
repository(repo: Class<Repository<any>>) {
7070
const repoKey = `repositories.${repo.name}`;
7171
this.bind(repoKey).toClass(repo);
7272
}
7373

7474
/**
75-
* Add a component to this application. Also mounts
76-
* all the components repositories.
77-
*
78-
* @param component The component to add.
79-
*
80-
* ```ts
81-
*
82-
* export class ProductComponent {
83-
* controllers = [ProductController];
84-
* repositories = [ProductRepo, UserRepo];
85-
* providers = {
86-
* [AUTHENTICATION_STRATEGY]: AuthStrategy,
87-
* [AUTHORIZATION_ROLE]: Role,
88-
* };
89-
* };
90-
*
91-
* app.component(ProductComponent);
92-
* ```
93-
*/
75+
* Add a component to this application. Also mounts
76+
* all the components repositories.
77+
*
78+
* @param component The component to add.
79+
*
80+
* ```ts
81+
*
82+
* export class ProductComponent {
83+
* controllers = [ProductController];
84+
* repositories = [ProductRepo, UserRepo];
85+
* providers = {
86+
* [AUTHENTICATION_STRATEGY]: AuthStrategy,
87+
* [AUTHORIZATION_ROLE]: Role,
88+
* };
89+
* };
90+
*
91+
* app.component(ProductComponent);
92+
* ```
93+
*/
9494
public component(component: Class<any>) {
9595
super.component(component);
9696
this.mountComponentRepository(component);
9797
}
9898

9999
/**
100-
* Get an instance of a component and mount all it's
101-
* repositories. This function is intended to be used internally
102-
* by component()
103-
*
104-
* @param component The component to mount repositories of
105-
*/
100+
* Get an instance of a component and mount all it's
101+
* repositories. This function is intended to be used internally
102+
* by component()
103+
*
104+
* @param component The component to mount repositories of
105+
*/
106106
mountComponentRepository(component: Class<any>) {
107107
const componentKey = `components.${component.name}`;
108108
const compInstance = this.getSync(componentKey);

0 commit comments

Comments
 (0)