mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
feat: update to Angular 13, move from tslint to eslint
This commit is contained in:
parent
7845cb750e
commit
d51cabf1d1
10 changed files with 123 additions and 24 deletions
57
.eslintrc.json
Normal file
57
.eslintrc.json
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"ignorePatterns": [
|
||||||
|
"projects/**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"tsconfig.json",
|
||||||
|
"e2e/tsconfig.json"
|
||||||
|
],
|
||||||
|
"createDefaultProgram": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:@angular-eslint/recommended",
|
||||||
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"@angular-eslint/no-input-rename": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
"allowedNames": ["name"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@angular-eslint/component-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"prefix": "ngx",
|
||||||
|
"style": "kebab-case",
|
||||||
|
"type": "element"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@angular-eslint/directive-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"prefix": "ngx",
|
||||||
|
"style": "camelCase",
|
||||||
|
"type": "attribute"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.html"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:@angular-eslint/template/recommended"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
21
angular.json
21
angular.json
|
|
@ -148,14 +148,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-eslint/builder:lint",
|
||||||
"options": {
|
"options": {
|
||||||
"tsConfig": [
|
"lintFilePatterns": [
|
||||||
"src/tsconfig.app.json",
|
"src/**/*.ts",
|
||||||
"src/tsconfig.spec.json"
|
"src/**/*.html"
|
||||||
],
|
]
|
||||||
"typeCheck": true,
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -171,15 +169,6 @@
|
||||||
"protractorConfig": "./protractor.conf.js",
|
"protractorConfig": "./protractor.conf.js",
|
||||||
"devServerTarget": "ngx-admin-demo:serve"
|
"devServerTarget": "ngx-admin-demo:serve"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"lint": {
|
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
|
||||||
"options": {
|
|
||||||
"tsConfig": [
|
|
||||||
"e2e/tsconfig.e2e.json"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
43
e2e/.eslintrc.json
Normal file
43
e2e/.eslintrc.json
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"extends": "../.eslintrc.json",
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"e2e/tsconfig.app.json",
|
||||||
|
"e2e/tsconfig.spec.json",
|
||||||
|
"e2e/e2e/tsconfig.json"
|
||||||
|
],
|
||||||
|
"createDefaultProgram": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"@angular-eslint/directive-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"style": "camelCase"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@angular-eslint/component-selector": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"type": "element",
|
||||||
|
"style": "kebab-case"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.html"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
5
package-lock.json
generated
5
package-lock.json
generated
|
|
@ -19563,6 +19563,11 @@
|
||||||
"defaults": "^1.0.3"
|
"defaults": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"web-animations-js": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-TOMFWtQdxzjWp8qx4DAraTWTsdhxVSiWa6NkPFSaPtZ1diKUxTn4yTix73A1euG1WbSOMMPcY51cnjTIHrGtDA=="
|
||||||
|
},
|
||||||
"webdriver-js-extender": {
|
"webdriver-js-extender": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@
|
||||||
"tinymce": "4.5.7",
|
"tinymce": "4.5.7",
|
||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"typeface-exo": "0.0.22",
|
"typeface-exo": "0.0.22",
|
||||||
|
"web-animations-js": "^2.3.2",
|
||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
[attr.d]="strokedArea.d" *ngFor="let strokedArea of roomSvg.stokedAreas"/>
|
[attr.d]="strokedArea.d" *ngFor="let strokedArea of roomSvg.stokedAreas"/>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<g [attr.id]="room.id" [class.selected-room]="selectedRoom == room.id" *ngFor="let room of sortedRooms">
|
<g [attr.id]="room.id" [class.selected-room]="selectedRoom === room.id" *ngFor="let room of sortedRooms">
|
||||||
<path class="room-bg" (click)="selectRoom(room.id)" [attr.d]="room.area.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
|
<path class="room-bg" (click)="selectRoom(room.id)" [attr.d]="room.area.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
|
||||||
<path class="room-border" [attr.d]="room.border.d" />
|
<path class="room-border" [attr.d]="room.border.d" />
|
||||||
<path class="room-border room-border-glow" [attr.d]="room.border.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
|
<path class="room-border room-border-glow" [attr.d]="room.border.d" [style.filter]="isIE || isFirefox ? 'inherit': ''" />
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export class RoomSelectorComponent implements OnInit, OnDestroy {
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
private hideGrid: boolean;
|
private hideGrid: boolean;
|
||||||
|
|
||||||
@Output() select: EventEmitter<number> = new EventEmitter();
|
@Output() selectEvent: EventEmitter<number> = new EventEmitter();
|
||||||
|
|
||||||
selectedRoom = null;
|
selectedRoom = null;
|
||||||
sortedRooms = [];
|
sortedRooms = [];
|
||||||
|
|
@ -108,7 +108,7 @@ export class RoomSelectorComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
selectRoom(roomNumber) {
|
selectRoom(roomNumber) {
|
||||||
this.select.emit(roomNumber);
|
this.selectEvent.emit(roomNumber);
|
||||||
this.selectedRoom = roomNumber;
|
this.selectedRoom = roomNumber;
|
||||||
this.sortRooms();
|
this.sortRooms();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export class SolarComponent implements AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
private value = 0;
|
private value = 0;
|
||||||
|
|
||||||
@Input('chartValue')
|
@Input()
|
||||||
set chartValue(value: number) {
|
set chartValue(value: number) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export class CountryOrdersMapComponent implements OnDestroy {
|
||||||
|
|
||||||
@Input() countryId: string;
|
@Input() countryId: string;
|
||||||
|
|
||||||
@Output() select: EventEmitter<any> = new EventEmitter();
|
@Output() selectEvent: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
layers = [];
|
layers = [];
|
||||||
currentTheme: any;
|
currentTheme: any;
|
||||||
|
|
@ -124,7 +124,7 @@ export class CountryOrdersMapComponent implements OnDestroy {
|
||||||
this.resetHighlight(this.selectedCountry);
|
this.resetHighlight(this.selectedCountry);
|
||||||
this.highlightFeature(featureLayer);
|
this.highlightFeature(featureLayer);
|
||||||
this.selectedCountry = featureLayer;
|
this.selectedCountry = featureLayer;
|
||||||
this.select.emit(featureLayer.feature.properties.name);
|
this.selectEvent.emit(featureLayer.feature.properties.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component, HostBinding, HostListener } from '@angular/core';
|
||||||
import { NbCalendarDayCellComponent } from '@nebular/theme';
|
import { NbCalendarDayCellComponent } from '@nebular/theme';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-day-cell',
|
selector: 'ngx-day-cell',
|
||||||
templateUrl: 'day-cell.component.html',
|
templateUrl: 'day-cell.component.html',
|
||||||
styleUrls: ['day-cell.component.scss'],
|
styleUrls: ['day-cell.component.scss'],
|
||||||
host: { '(click)': 'onClick()', 'class': 'day-cell' },
|
|
||||||
})
|
})
|
||||||
export class DayCellComponent extends NbCalendarDayCellComponent<Date> {
|
export class DayCellComponent extends NbCalendarDayCellComponent<Date> {
|
||||||
|
@HostBinding('class') classes = 'day-cell';
|
||||||
|
|
||||||
|
@HostListener('click') onClick() {
|
||||||
|
// do work
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue