Skip to content

Commit 6c27182

Browse files
timdeschryverMikeRyanDev
authored andcommitted
build: Update Prettier
* Created prettier config file (instead of passing the options as argument in package.json) * Also prettify json and md files * Only run prettier on staged files, not the whole codebase. * Ignore package files * Updated prettier version, hence the changes in the lock files * Ran prettier over the whole codebase
1 parent f17a032 commit 6c27182

File tree

12 files changed

+443
-2011
lines changed

12 files changed

+443
-2011
lines changed

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/dist
2-
/modules/schematics/src/*/files/*
2+
/modules/schematics/src/*/files/*
3+
package-lock.json
4+
package.json
5+
yarn.lock

build/tasks.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ async function _compilePackagesWithNgc(pkg: string) {
4141
: [pkg, 'index'];
4242

4343
const entryTypeDefinition = `export * from './${exportPath}/${moduleName}';`;
44-
const entryMetadata = `{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./${
45-
pkg
46-
}/index"}]}`;
44+
const entryMetadata = `{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./${pkg}/index"}]}`;
4745

4846
await Promise.all([
4947
util.writeFile(`./dist/packages/${pkg}.d.ts`, entryTypeDefinition),
@@ -241,9 +239,7 @@ export async function minifyUmdBundles(config: Config) {
241239
file,
242240
...uglifyArgs,
243241
`-o ${out}`,
244-
`--source-map "filename='${out}.map' includeSources='${file}', content='${
245-
file
246-
}.map'"`,
242+
`--source-map "filename='${out}.map' includeSources='${file}', content='${file}.map'"`,
247243
]);
248244
});
249245
}

modules/effects/spec/effects_feature_module.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ describe('Effects Feature Module', () => {
6868
store = TestBed.get(Store);
6969
});
7070

71-
it('should have the feature state defined to select from the effect', (
72-
done: any
73-
) => {
71+
it('should have the feature state defined to select from the effect', (done: any) => {
7472
const action = { type: 'INCREMENT' };
7573
const result = { type: 'INCREASE' };
7674

modules/effects/src/effect_notification.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function reportInvalidActions(
3636
if (isInvalidAction) {
3737
reporter.handleError(
3838
new Error(
39-
`Effect ${getEffectName(output)} dispatched an invalid action: ${
40-
action
41-
}`
39+
`Effect ${getEffectName(
40+
output
41+
)} dispatched an invalid action: ${action}`
4242
)
4343
);
4444
}

modules/router-store/spec/integration.spec.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ describe('integration spec', () => {
240240
});
241241
});
242242

243-
it('should call navigateByUrl when resetting state of the routerReducer', (
244-
done: any
245-
) => {
243+
it('should call navigateByUrl when resetting state of the routerReducer', (done: any) => {
246244
const reducer = (state: any, action: RouterAction<any>) => {
247245
const r = routerReducer(state, action);
248246
return r && r.state
@@ -338,9 +336,7 @@ describe('integration spec', () => {
338336
});
339337
});
340338

341-
it('should support cancellation of initial navigation using canLoad guard', (
342-
done: any
343-
) => {
339+
it('should support cancellation of initial navigation using canLoad guard', (done: any) => {
344340
const reducer = (state: any, action: RouterAction<any>) => {
345341
const r = routerReducer(state, action);
346342
return r && r.state
@@ -369,9 +365,7 @@ describe('integration spec', () => {
369365
done();
370366
});
371367

372-
it('should support a custom RouterStateSnapshot serializer ', (
373-
done: any
374-
) => {
368+
it('should support a custom RouterStateSnapshot serializer ', (done: any) => {
375369
const reducer = (state: any, action: RouterAction<any>) => {
376370
const r = routerReducer(state, action);
377371
return r && r.state

modules/schematics/src/utility/ast-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ function _addSymbolToNgModuleMetadata(
415415
// Get the indentation of the last element, if any.
416416
const text = node.getFullText(source);
417417
if (text.match('^\r?\r?\n')) {
418-
toInsert = `,${text.match(/^\r?\n\s+/)[0]}${metadataField}: [${
419-
symbolName
420-
}]`;
418+
toInsert = `,${
419+
text.match(/^\r?\n\s+/)[0]
420+
}${metadataField}: [${symbolName}]`;
421421
} else {
422422
toInsert = `, ${metadataField}: [${symbolName}]`;
423423
}

modules/schematics/src/utility/change.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ export class ReplaceChange implements Change {
112112
if (pos < 0) {
113113
throw new Error('Negative positions are invalid');
114114
}
115-
this.description = `Replaced ${oldText} into position ${pos} of ${
116-
path
117-
} with ${newText}`;
115+
this.description = `Replaced ${oldText} into position ${pos} of ${path} with ${newText}`;
118116
this.order = pos;
119117
}
120118

modules/store/src/reducer_manager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export class ReducerManager extends BehaviorSubject<ActionReducer<any, any>>
7272

7373
private updateReducers(key: string) {
7474
this.next(this.reducerFactory(this.reducers, this.initialState));
75-
this.dispatcher.next(<Action & {feature: string}>{ type: UPDATE, feature: key });
75+
this.dispatcher.next(<Action & { feature: string }>{
76+
type: UPDATE,
77+
feature: key,
78+
});
7679
}
7780

7881
ngOnDestroy() {

0 commit comments

Comments
 (0)