Skip to content

Commit 93446bc

Browse files
fix(ref: no-ref): update ng 19
1 parent 23268a7 commit 93446bc

File tree

9 files changed

+25
-22
lines changed

9 files changed

+25
-22
lines changed

eslint.config.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ module.exports = tseslint.config(
3535
// Everything in this config object targets our TypeScript files (Components, Directives, Pipes etc)
3636
files: ['**/*.ts'],
3737
extends: [
38-
// Apply the recommended core rules
3938
eslint.configs.recommended,
40-
// Apply the recommended TypeScript rules
41-
...tseslint.configs.recommended,
42-
// Optionally apply stylistic rules from typescript-eslint that improve code consistency
43-
...tseslint.configs.stylistic,
44-
// Apply the recommended Angular rules
39+
...tseslint.configs.recommendedTypeChecked,
40+
...tseslint.configs.strictTypeChecked,
41+
...tseslint.configs.stylisticTypeChecked,
4542
...angular.configs.tsRecommended,
4643
],
4744
// Set the custom processor which will allow us to have our inline Component templates extracted
@@ -104,7 +101,6 @@ module.exports = tseslint.config(
104101
'no-unused-private-class-members': 'error',
105102
'no-invalid-regexp': 'error',
106103
curly: ['error', 'all'],
107-
'@typescript-eslint/restrict-template-expressions': 'error',
108104
'@typescript-eslint/no-explicit-any': 'off',
109105
'@typescript-eslint/adjacent-overload-signatures': 'error',
110106
'no-console': ['warn'],
@@ -157,6 +153,14 @@ module.exports = tseslint.config(
157153
'@typescript-eslint/unbound-method': 'off',
158154
'import/no-cycle': 'off',
159155
'import/extensions': 'off',
156+
'@typescript-eslint/no-unsafe-call': 'off',
157+
'@typescript-eslint/restrict-template-expressions': [
158+
'error',
159+
{
160+
allowNullish: true,
161+
allowNumber: true,
162+
},
163+
],
160164
},
161165
},
162166
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('First test group', () => {
22
it('First test', () => {
3-
expect(1).toEqual(1);
3+
void expect(1).toEqual(1);
44
});
55
});

projects/ngx-loader-indicator-lib/src/lib/ngx-loader-indicator.directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ export class NgxLoaderIndicatorDirective {
2121
}
2222
private processValue(value: boolean) {
2323
if (!value) {
24-
if (this.loaderEl) {
24+
if (this.loaderEl instanceof HTMLDivElement) {
2525
this._setStyles(this.loaderEl, { display: 'none' });
2626
}
2727
return;
2828
}
2929
const { rotate, hostStyles, loaderStyles, imgStyles, img } = this._config;
3030

31-
this.loaderEl = this._renderer.createElement('div');
32-
const imgEl = this._renderer.createElement('img');
31+
this.loaderEl = this._renderer.createElement('div') as HTMLDivElement;
32+
const imgEl = this._renderer.createElement('img') as HTMLImageElement;
3333

3434
imgEl.animate([{ transform: 'rotate(360deg)' }, { transform: 'rotate(0deg)' }], rotate);
3535

3636
this._renderer.appendChild(this._el.nativeElement, this.loaderEl);
3737
this._renderer.appendChild(this.loaderEl, imgEl);
3838

39-
this._setStyles(this._el.nativeElement, hostStyles);
39+
this._setStyles(this._el.nativeElement as HTMLElement, hostStyles);
4040
this._setStyles(this.loaderEl, loaderStyles);
4141
this._setStyles(imgEl, imgStyles);
4242

projects/ngx-loader-indicator-lib/src/lib/ngx-loader-indicator.providers.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ export function _configFactory(
1212
initConfig: optionsConfig,
1313
configValue: optionsConfig
1414
): optionsConfig {
15-
const loaderStyles: Config['loaderStyles'] | null = configValue
16-
? configValue.loaderStyles
17-
: null;
18-
const imgStyles: Config['imgStyles'] | null = configValue ? configValue.imgStyles : null;
19-
const rotate: Config['rotate'] | null = configValue ? configValue.rotate : null;
15+
const loaderStyles: Config['loaderStyles'] | null = configValue.loaderStyles ?? null;
16+
const imgStyles: Config['imgStyles'] | null = configValue.imgStyles ?? null;
17+
const rotate: Config['rotate'] | null = configValue.rotate ?? null;
2018

2119
return {
2220
...initConfig,

src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('App component', () => {
22
it('First test', () => {
3-
expect(1).toEqual(1);
3+
void expect(1).toEqual(1);
44
});
55
});

src/app/cards/cards.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { HighlightModule } from 'ngx-highlightjs';
44
import { NgxLoaderIndicatorDirective } from 'ngx-loader-indicator';
55
import { CardItem } from './cards.type';
66
import { ScrollService } from '@open-source/scroll/scroll.service';
7-
import { ColorPipe } from '@open-source/color/color.pipe';
87
import { AssetPipe } from '@libraries/asset/asset.pipe';
98
import { CustomLoaderComponent } from '../custom-loader/custom-loader.component';
109
import { FormComponent } from '../shared/form/form.component';
@@ -19,7 +18,6 @@ import { toSignal } from '@angular/core/rxjs-interop';
1918
NgOptimizedImage,
2019
HighlightModule,
2120
NgxLoaderIndicatorDirective,
22-
ColorPipe,
2321
AssetPipe,
2422
CustomLoaderComponent,
2523
FormComponent,

src/app/custom-loader/custom-loader.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ import { NgxLoaderIndicatorDirective, provideNgxLoaderIndicator } from 'ngx-load
2525
}),
2626
],
2727
})
28+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
2829
export class CustomLoaderComponent {}

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ bootstrapApplication(AppComponent, {
3030
},
3131
},
3232
],
33+
}).catch((err: unknown) => {
3334
// eslint-disable-next-line no-console
34-
}).catch((err) => console.error(err));
35+
console.error(err);
36+
});

0 commit comments

Comments
 (0)