Skip to content
This repository was archived by the owner on Jun 18, 2020. It is now read-only.

Commit 98cc12c

Browse files
committed
feat: add angular-ru tsconfig.json
1 parent ad5f1c4 commit 98cc12c

32 files changed

Lines changed: 10683 additions & 22661 deletions

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ node_js:
66
install:
77
- npm install
88
script:
9-
- npm run lint
109
- npm test
1110
- npm run build
1211
after_success:

helpers/console-fake.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class ConsoleFake implements Console {
2323
private _stack: ObjectKeyMap[] = [];
2424

2525
public log(...args: string[]): void {
26-
args.unshift(null, null);
26+
args.unshift(null!, null!);
2727
this._stack.push({ [TestLoggerLineType.LOG]: args });
2828
}
2929

@@ -74,8 +74,8 @@ export class ConsoleFake implements Console {
7474
history.forEach((line: object, index: number) => {
7575
for (const arg in line) {
7676
if (line.hasOwnProperty(arg)) {
77-
const isArray: boolean = Array.isArray(line[arg]);
78-
history[index] = { [arg]: isArray ? line[arg].slice(withoutLabel) : line[arg] };
77+
const isArray: boolean = Array.isArray((line as any)[arg]);
78+
history[index] = { [arg]: isArray ? (line as any)[arg].slice(withoutLabel) : (line as any)[arg] };
7979
}
8080
}
8181
});

helpers/test.component.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ interface HttpDebugInterface {
2525
// noinspection AngularMissingOrInvalidDeclarationInModule
2626
@Component({ selector: 'lib-hello-test', template: '' })
2727
export class MyTestComponent implements OnInit {
28-
@Logger() public logger: LoggerService;
29-
@TraceLog() public trace: LogFn;
30-
@DebugLog() public debug: LogFn;
31-
@InfoLog() public info: LogFn;
32-
@ErrorLog() public error: LogFn;
33-
@WarnLog() public warn: LogFn;
34-
@Log() public log: LogFn;
28+
@Logger() public logger!: LoggerService;
29+
@TraceLog() public trace!: LogFn;
30+
@DebugLog() public debug!: LogFn;
31+
@InfoLog() public info!: LogFn;
32+
@ErrorLog() public error!: LogFn;
33+
@WarnLog() public warn!: LogFn;
34+
@Log() public log!: LogFn;
3535

3636
public count: number = 0;
37-
public hook: string;
38-
public doneHeavy: boolean;
37+
public hook: string | null = null;
38+
public doneHeavy: boolean = false;
3939
public name: string = 'MockLoggerComponent';
4040

4141
@Group('Test group')
@@ -101,7 +101,7 @@ export class MyTestComponent implements OnInit {
101101
}
102102

103103
public longQueryBySecondMs(seconds: number, done: Fn): void {
104-
const info: TimerInfo = this.logger.startTime('longQueryBySecondMs');
104+
const info: TimerInfo | null = this.logger.startTime('longQueryBySecondMs');
105105
this.extracted(seconds, done);
106106
this.logger.endTime(info);
107107
}

package-lock.json

Lines changed: 0 additions & 22495 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"start": "ng serve",
88
"copy-readme": "ts-node --project tsconfig.tools.json ./tools/copy-readme",
99
"build": "ng build logger && npm run copy-readme",
10+
"build:app": "ng build",
1011
"build.meta": "echo 'prebuild'",
1112
"test": "jest --config ./jest.app.config.js --coverage",
1213
"lint": "ng lint",
@@ -36,8 +37,9 @@
3637
"zone.js": "~0.10.3"
3738
},
3839
"devDependencies": {
39-
"@angular-devkit/build-angular": "^0.901.5",
40-
"@angular-devkit/build-ng-packagr": "~0.901.5",
40+
"@angular-ru/tsconfig": "^12.19.1",
41+
"@angular-devkit/build-angular": "^0.803.27",
42+
"@angular-devkit/build-ng-packagr": "~0.803.27",
4143
"@angular/cli": "~8.3.21",
4244
"@angular/compiler-cli": "~8.2.14",
4345
"@angular/language-service": "~8.2.14",

projects/logger/src/lib/decorators/autobind.decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function autoBind(...args: Any[]): Any {
8484
}
8585

8686
function createDefaultSetter(key: Any): Fn {
87-
return function set(newValue: unknown): unknown {
87+
return function set(this: any, newValue: unknown): unknown {
8888
Object.defineProperty(this, key, {
8989
configurable: true,
9090
writable: true,

projects/logger/src/lib/decorators/debug.decorator.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { Type } from '@angular/core';
2-
31
import { LoggerInjector } from '../logger.injector';
42
import { LoggerService } from '../logger.service';
53
import { LogFn } from '../interfaces/logger.external';
64

75
export function DebugLog(): PropertyDecorator {
8-
return (target: Type<unknown>, propertyName: string): void => {
6+
return (target: unknown, propertyName: string | symbol): void => {
97
Object.defineProperty(target, propertyName, {
108
configurable: false,
119
get(): LogFn {

projects/logger/src/lib/decorators/error.decorator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { Type } from '@angular/core';
21
import { LoggerInjector } from '../logger.injector';
32
import { LoggerService } from '../logger.service';
43
import { LogFn } from '../interfaces/logger.external';
54

65
export function ErrorLog(): PropertyDecorator {
7-
return (target: Type<unknown>, propertyName: string): void => {
6+
return (target: unknown, propertyName: string | symbol): void => {
87
Object.defineProperty(target, propertyName, {
98
configurable: false,
109
get(): LogFn {

projects/logger/src/lib/decorators/groups/group-collapsed.decorator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Type } from '@angular/core';
22

33
import { groupDecoratorFactory } from './group.common';
4-
import { Any, Callback, DecoratorMethod } from '../../interfaces/logger.internal';
4+
import { Any, Callback, DecoratorMethod, Fn } from "../../interfaces/logger.internal";
55
import { GroupLevel, LoggerLevel } from '../../interfaces/logger.external';
66

77
export function GroupCollapsed(title: string | Callback<Any>, level: LoggerLevel = LoggerLevel.INFO): DecoratorMethod {
88
return (_target: Type<unknown>, _key: string, descriptor: PropertyDescriptor): PropertyDescriptor => {
99
const method: Callback = descriptor.value;
1010

1111
descriptor.value = function(...args: Any[]): unknown {
12-
return groupDecoratorFactory(level, GroupLevel.GROUP_COLLAPSED, method, title, args, this);
12+
return groupDecoratorFactory(level, GroupLevel.GROUP_COLLAPSED, method as Fn, title, args, this as any);
1313
};
1414

1515
return descriptor;

projects/logger/src/lib/decorators/groups/group.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function groupDecoratorFactory(
1616
let result: unknown;
1717
const logger: LoggerService = LoggerInjector.getInjector().get<LoggerService>(LoggerService);
1818
const groupFactory: GroupFactory = LoggerInjector.getInjector().get<GroupFactory>(GroupFactory);
19-
const groupMethod: GroupMethod = groupFactory[groupType].bind(groupFactory);
19+
const groupMethod: GroupMethod = groupFactory[groupType].bind(groupFactory) as GroupMethod;
2020
const label: string = typeof title === 'string' ? title : title(...args);
2121

2222
groupMethod(label, null, logger, level);

0 commit comments

Comments
 (0)