Browse Source

Fix lint issues. close No Var eslint rule.

pull/18111/head
Mahmut Gundogdu 3 years ago
parent
commit
17b027547e
  1. 2
      npm/ng-packs/.eslintrc.json
  2. 10
      npm/ng-packs/packages/components/extensible/src/lib/utils/typeahead.util.ts
  3. 7
      npm/ng-packs/packages/oauth/src/lib/oauth.module.ts
  4. 2
      npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts
  5. 2
      npm/ng-packs/packages/theme-shared/src/lib/models/nav-item.ts
  6. 2
      npm/ng-packs/packages/theme-shared/src/lib/services/page-alert.service.ts
  7. 1
      npm/ng-packs/packages/theme-shared/src/lib/tests/form-input.component.spec.ts
  8. 1
      npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts

2
npm/ng-packs/.eslintrc.json

@ -28,9 +28,11 @@
"files": ["*.ts", "*.tsx"], "files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"], "extends": ["plugin:@nx/typescript"],
"rules": { "rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-function": ["warn"], "@typescript-eslint/no-empty-function": ["warn"],
"@typescript-eslint/no-empty-interface": ["warn"] "@typescript-eslint/no-empty-interface": ["warn"]
} }
}, },
{ {

10
npm/ng-packs/packages/components/extensible/src/lib/utils/typeahead.util.ts

@ -39,11 +39,11 @@ export function createTypeaheadOptions(
} }
export function getTypeaheadType(lookup: ExtensionPropertyUiLookupDto, name: string) { export function getTypeaheadType(lookup: ExtensionPropertyUiLookupDto, name: string) {
return Boolean(lookup.url) if (!!lookup.url) {
? ePropType.Typeahead return ePropType.Typeahead;
: name.endsWith(TYPEAHEAD_TEXT_SUFFIX) } else {
? ePropType.Hidden return name.endsWith(TYPEAHEAD_TEXT_SUFFIX) ? ePropType.Hidden : undefined;
: undefined; }
} }
export function createTypeaheadDisplayNameGenerator( export function createTypeaheadDisplayNameGenerator(

7
npm/ng-packs/packages/oauth/src/lib/oauth.module.ts

@ -4,6 +4,7 @@ import { OAuthModule, OAuthStorage } from 'angular-oauth2-oidc';
import { import {
AbpLocalStorageService, AbpLocalStorageService,
ApiInterceptor, ApiInterceptor,
AuthGuard,
authGuard, authGuard,
AuthService, AuthService,
CHECK_AUTHENTICATION_STATE_FN_KEY, CHECK_AUTHENTICATION_STATE_FN_KEY,
@ -14,7 +15,7 @@ import { AbpOAuthService } from './services';
import { OAuthConfigurationHandler } from './handlers/oauth-configuration.handler'; import { OAuthConfigurationHandler } from './handlers/oauth-configuration.handler';
import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { OAuthApiInterceptor } from './interceptors/api.interceptor'; import { OAuthApiInterceptor } from './interceptors/api.interceptor';
import { abpOAuthGuard } from './guards/oauth.guard'; import { AbpOAuthGuard, abpOAuthGuard } from './guards/oauth.guard';
import { NavigateToManageProfileProvider } from './providers'; import { NavigateToManageProfileProvider } from './providers';
import { checkAccessToken, pipeToLogin } from './utils'; import { checkAccessToken, pipeToLogin } from './utils';
@ -30,6 +31,10 @@ export class AbpOAuthModule {
provide: AuthService, provide: AuthService,
useClass: AbpOAuthService, useClass: AbpOAuthService,
}, },
{
provide: AuthGuard,
useClass: AbpOAuthGuard,
},
{ {
provide: authGuard, provide: authGuard,
useValue: abpOAuthGuard, useValue: abpOAuthGuard,

2
npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts

@ -31,5 +31,5 @@ export class TimeAdapter extends NgbTimeAdapter<string | Date> {
} }
function isTimeStr(value: string | Date): value is string { function isTimeStr(value: string | Date): value is string {
return /^((2[123])|[01][0-9])(\:[0-5][0-9]){1,2}$/.test(String(value)); return /^((2[123])|[01][0-9])(:[0-5][0-9]){1,2}$/.test(String(value));
} }

2
npm/ng-packs/packages/theme-shared/src/lib/models/nav-item.ts

@ -1,5 +1,5 @@
import { Injector, Type } from '@angular/core'; import { Injector, Type } from '@angular/core';
import { Observable, of } from 'rxjs'; import { Observable } from 'rxjs';
export interface Badge { export interface Badge {
count?: number | Observable<number>; count?: number | Observable<number>;

2
npm/ng-packs/packages/theme-shared/src/lib/services/page-alert.service.ts

@ -16,8 +16,6 @@ export class PageAlertService {
alerts$ = this.alerts.sliceState(state => state); alerts$ = this.alerts.sliceState(state => state);
constructor() {}
show(alert: PageAlert) { show(alert: PageAlert) {
const newAlert: PageAlert = { const newAlert: PageAlert = {
...alert, ...alert,

1
npm/ng-packs/packages/theme-shared/src/lib/tests/form-input.component.spec.ts

@ -1,4 +1,3 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest'; import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';
import { FormInputComponent } from '../components/form-input/form-input.component'; import { FormInputComponent } from '../components/form-input/form-input.component';

1
npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts

@ -7,7 +7,6 @@ import { LoaderBarComponent } from '../components/loader-bar/loader-bar.componen
describe('LoaderBarComponent', () => { describe('LoaderBarComponent', () => {
let spectator: Spectator<LoaderBarComponent>; let spectator: Spectator<LoaderBarComponent>;
let router: SpyObject<Router>;
const events$ = new Subject(); const events$ = new Subject();
const createComponent = createComponentFactory({ const createComponent = createComponentFactory({

Loading…
Cancel
Save