Skip to content

Commit

Permalink
ui lint sort imports and exports (#1750)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 authored Nov 20, 2023
1 parent 728c39f commit c8e505c
Show file tree
Hide file tree
Showing 164 changed files with 667 additions and 562 deletions.
2 changes: 1 addition & 1 deletion extract-plugin-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* This script "mocks" homebridge and is used to extract the plugin alias and type.
*/

const path = require('path');
const EventEmitter = require('events').EventEmitter;
const path = require('path');

let pluginAlias;
let pluginType;
Expand Down
2 changes: 1 addition & 1 deletion scripts/lang-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* - remove old translation strings from the other language files
*/

import * as fs from 'fs-extra';
import * as path from 'path';
import * as fs from 'fs-extra';

const basePath = path.dirname(__dirname);

Expand Down
7 changes: 7 additions & 0 deletions ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"plugins": [
"import", "import-newlines", "sort-exports"],
"rules": {
"@angular-eslint/component-selector": [
"error",
Expand Down Expand Up @@ -77,7 +79,12 @@
],
"id-blacklist": "off",
"id-match": "off",
"import-newlines/enforce": ["error", 3],
"import/no-extraneous-dependencies": "off",
"import/order": ["warn", { "alphabetize": { "order": "asc" }, "newlines-between": "never" }],
"no-underscore-dangle": "off",
"sort-exports/sort-exports": ["warn", { "sortDir": "asc" }],
"sort-imports": ["warn", { "ignoreDeclarationSort": true }],
"space-before-function-paren": "error"
}
},
Expand Down
26 changes: 26 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@
"codelyzer": "^6.0.2",
"eslint": "^8.54.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import-newlines": "^1.3.4",
"eslint-plugin-jsdoc": "^41.1.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-sort-exports": "^0.8.0",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
},
Expand Down
9 changes: 4 additions & 5 deletions ui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { AuthGuard } from '@/app/core/auth/auth.guard';
import { RouterModule, Routes } from '@angular/router';
import { AdminGuard } from '@/app/core/auth/admin.guard';
import { AuthGuard } from '@/app/core/auth/auth.guard';
import { LoginComponent } from '@/app/modules/login/login.component';
import { LoginGuard } from '@/app/modules/login/login.guard';
import { RestartComponent } from '@/app/modules/restart/restart.component';
import { SetupWizardGuard } from '@/app/modules/setup-wizard/setup-wizard.guard';
import { StatusComponent } from '@/app/modules/status/status.component';
import { LayoutComponent } from '@/app/shared/layout/layout.component';

/*
* The status and restart modules should not be lazy loaded
* to ensure restarts after an update go smoothly
*/
import { RestartComponent } from '@/app/modules/restart/restart.component';
import { StatusComponent } from '@/app/modules/status/status.component';

const routes: Routes = [
{
Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { NavigationEnd, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';

import { SettingsService } from '@/app/core/settings.service';

@Component({
Expand Down
24 changes: 11 additions & 13 deletions ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { HttpClientModule } from '@angular/common/http';
import { LOCALE_ID, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { NgModule, LOCALE_ID } from '@angular/core';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ToastrModule } from 'ngx-toastr';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { MonacoEditorModule } from 'ngx-monaco-editor';
import { DragulaModule } from 'ng2-dragula';

import { CoreModule } from '@/app/core/core.module';
import { AuthModule } from '@/app/core/auth/auth.module';
import { onMonacoLoad } from '@/app/core/monaco-editor.service';
import { supportedLocales } from '@/app/core/locales';

import { AppComponent } from './app.component';
import { MonacoEditorModule } from 'ngx-monaco-editor';
import { ToastrModule } from 'ngx-toastr';
import { AppRoutingModule } from './app-routing.module';
import { LayoutComponent } from './shared/layout/layout.component';
import { AppComponent } from './app.component';
import { LoginModule } from './modules/login/login.module';
import { RestartModule } from './modules/restart/restart.module';
import { StatusModule } from './modules/status/status.module';
import { LoginModule } from './modules/login/login.module';
import { LayoutComponent } from './shared/layout/layout.component';
import { AuthModule } from '@/app/core/auth/auth.module';
import { CoreModule } from '@/app/core/core.module';
import { supportedLocales } from '@/app/core/locales';
import { onMonacoLoad } from '@/app/core/monaco-editor.service';

@NgModule({
declarations: [
Expand Down
70 changes: 34 additions & 36 deletions ui/src/app/core/accessories/accessories.module.ts
Original file line number Diff line number Diff line change
@@ -1,61 +1,59 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import { NgxMdModule } from 'ngx-md';
import { InlineSVGModule } from 'ng-inline-svg';
import { NouisliderModule } from 'ng2-nouislider';

import { CoreModule } from '@/app/core/core.module';
import { NgxMdModule } from 'ngx-md';
import { AccessoriesService } from './accessories.service';

import { SwitchComponent } from './types/switch/switch.component';
import { StatelessprogrammableswitchComponent } from './types/statelessprogrammableswitch/statelessprogrammableswitch.component';
import { ThermostatComponent } from './types/thermostat/thermostat.component';
import { ThermostatManageComponent } from './types/thermostat/thermostat.manage.component';
import { OutletComponent } from './types/outlet/outlet.component';
import { AccessoryTileComponent } from './accessory-tile/accessory-tile.component';
import { InfoModalComponent } from './info-modal/info-modal.component';
import { AirpurifierComponent } from './types/airpurifier/airpurifier.component';
import { AirpurifierManageComponent } from './types/airpurifier/airpurifier.manage.component';
import { AirqualitysensorComponent } from './types/airqualitysensor/airqualitysensor.component';
import { BatteryserviceComponent } from './types/batteryservice/batteryservice.component';
import { ContactsensorComponent } from './types/contactsensor/contactsensor.component';
import { DoorComponent } from './types/door/door.component';
import { DoorManageComponent } from './types/door/door.manage.component';
import { FanComponent } from './types/fan/fan.component';
import { FanManageComponent } from './types/fan/fan.manage.component';
import { Fanv2Component } from './types/fanv2/fanv2.component';
import { Fanv2ManageComponent } from './types/fanv2/fanv2.manage.component';
import { UnknownComponent } from './types/unknown/unknown.component';
import { GaragedooropenerComponent } from './types/garagedooropener/garagedooropener.component';
import { HeaterCoolerComponent } from './types/heatercooler/heatercooler.component';
import { HeaterCoolerManageComponent } from './types/heatercooler/heatercooler.manage.component';
import { HumidifierDehumidifierComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.component';
import { HumidifierDehumidifierManageComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.manage.component';
import { HumiditysensorComponent } from './types/humiditysensor/humiditysensor.component';
import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsystem.component';
import { LeaksensorComponent } from './types/leaksensor/leaksensor.component';
import { LightbulbComponent } from './types/lightbulb/lightbulb.component';
import { LightbulbManageComponent } from './types/lightbulb/lightbulb.manage.component';
import { LightsensorComponent } from './types/lightsensor/lightsensor.component';
import { LockmechanismComponent } from './types/lockmechanism/lockmechanism.component';
import { TemperaturesensorComponent } from './types/temperaturesensor/temperaturesensor.component';
import { GaragedooropenerComponent } from './types/garagedooropener/garagedooropener.component';
import { MotionsensorComponent } from './types/motionsensor/motionsensor.component';
import { OccupancysensorComponent } from './types/occupancysensor/occupancysensor.component';
import { HumiditysensorComponent } from './types/humiditysensor/humiditysensor.component';
import { AirqualitysensorComponent } from './types/airqualitysensor/airqualitysensor.component';
import { WindowcoveringComponent } from './types/windowcovering/windowcovering.component';
import { WindowcoveringManageComponent } from './types/windowcovering/windowcovering.manage.component';
import { WindowComponent } from './types/window/window.component';
import { WindowManageComponent } from './types/window/window.manage.component';
import { DoorComponent } from './types/door/door.component';
import { DoorManageComponent } from './types/door/door.manage.component';
import { TelevisionComponent } from './types/television/television.component';
import { ContactsensorComponent } from './types/contactsensor/contactsensor.component';
import { BatteryserviceComponent } from './types/batteryservice/batteryservice.component';
import { SpeakerComponent } from './types/speaker/speaker.component';
import { SpeakerManageComponent } from './types/speaker/speaker.manage.component';
import { OutletComponent } from './types/outlet/outlet.component';
import { SecuritysystemComponent } from './types/securitysystem/securitysystem.component';
import { SecuritysystemManageComponent } from './types/securitysystem/securitysystem.manage.component';
import { LeaksensorComponent } from './types/leaksensor/leaksensor.component';
import { SmokesensorComponent } from './types/smokesensor/smokesensor.component';
import { SpeakerComponent } from './types/speaker/speaker.component';
import { SpeakerManageComponent } from './types/speaker/speaker.manage.component';
import { StatelessprogrammableswitchComponent } from './types/statelessprogrammableswitch/statelessprogrammableswitch.component';
import { SwitchComponent } from './types/switch/switch.component';
import { TelevisionComponent } from './types/television/television.component';
import { TemperaturesensorComponent } from './types/temperaturesensor/temperaturesensor.component';
import { ThermostatComponent } from './types/thermostat/thermostat.component';
import { ThermostatManageComponent } from './types/thermostat/thermostat.manage.component';
import { UnknownComponent } from './types/unknown/unknown.component';
import { ValveComponent } from './types/valve/valve.component';
import { ValveManageComponent } from './types/valve/valve.manage.component';
import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsystem.component';
import { AirpurifierComponent } from './types/airpurifier/airpurifier.component';
import { AirpurifierManageComponent } from './types/airpurifier/airpurifier.manage.component';
import { HeaterCoolerComponent } from './types/heatercooler/heatercooler.component';
import { HeaterCoolerManageComponent } from './types/heatercooler/heatercooler.manage.component';
import { HumidifierDehumidifierComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.component';
import { HumidifierDehumidifierManageComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.manage.component';
import { InfoModalComponent } from './info-modal/info-modal.component';
import { AccessoryTileComponent } from './accessory-tile/accessory-tile.component';
import { WindowComponent } from './types/window/window.component';
import { WindowManageComponent } from './types/window/window.manage.component';
import { WindowcoveringComponent } from './types/windowcovering/windowcovering.component';
import { WindowcoveringManageComponent } from './types/windowcovering/windowcovering.manage.component';
import { CoreModule } from '@/app/core/core.module';

@NgModule({
declarations: [
Expand Down
7 changes: 3 additions & 4 deletions ui/src/app/core/accessories/accessories.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Injectable } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceType } from '@oznu/hap-client';
import { ToastrService } from 'ngx-toastr';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { Subject } from 'rxjs';

import { WsService, IoNamespace } from '../ws.service';
import { AuthService } from '../auth/auth.service';
import { ApiService } from '../api.service';
import { AuthService } from '../auth/auth.service';
import { IoNamespace, WsService } from '../ws.service';
import { ServiceTypeX } from './accessories.interfaces';
import { InfoModalComponent } from './info-modal/info-modal.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { AirpurifierManageComponent } from './airpurifier.manage.component';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
selector: 'app-airpurifier-manage',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/core/accessories/types/door/door.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { DoorManageComponent } from './door.manage.component';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
selector: 'app-door-manage',
Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/core/accessories/types/fan/fan.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { FanManageComponent } from './fan.manage.component';

@Component({
Expand Down
5 changes: 2 additions & 3 deletions ui/src/app/core/accessories/types/fan/fan.manage.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
selector: 'app-fan-manage',
Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/core/accessories/types/fanv2/fanv2.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { Fanv2ManageComponent } from './fanv2.manage.component';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ServiceTypeX } from '../../accessories.interfaces';

import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
selector: 'app-fanv2-manage',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { ServiceTypeX } from '../../accessories.interfaces';

@Component({
Expand Down
Loading

0 comments on commit c8e505c

Please sign in to comment.