Skip to content

Commit d6a2dbe

Browse files
mathisGarbergMathis Garberg
and
Mathis Garberg
authored
ISSUE-130: fix lint errors (mathisGarberg#131)
Co-authored-by: Mathis Garberg <[email protected]>
1 parent 4038c56 commit d6a2dbe

12 files changed

+32
-234
lines changed

.eslintrc.json

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{
22
"root": true,
3-
"ignorePatterns": [
4-
"projects/**/*"
5-
],
3+
"ignorePatterns": ["projects/**/*"],
64
"overrides": [
75
{
8-
"files": [
9-
"*.ts"
10-
],
6+
"files": ["*.ts"],
117
"parserOptions": {
12-
"project": [
13-
"tsconfig.json",
14-
"e2e/tsconfig.json"
15-
],
8+
"project": ["tsconfig.json", "e2e/tsconfig.json"],
169
"createDefaultProgram": true
1710
},
1811
"extends": [
@@ -31,16 +24,14 @@
3124
],
3225
"id-blacklist": "off",
3326
"id-match": "off",
34-
"no-underscore-dangle": "off"
27+
"no-underscore-dangle": "off",
28+
"prefer-arrow/prefer-arrow-functions": "off",
29+
"no-var": "off"
3530
}
3631
},
3732
{
38-
"files": [
39-
"*.html"
40-
],
41-
"extends": [
42-
"plugin:@angular-eslint/template/recommended"
43-
],
33+
"files": ["*.html"],
34+
"extends": ["plugin:@angular-eslint/template/recommended"],
4435
"rules": {}
4536
}
4637
]

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "ng serve --aot",
99
"build": "ng build",
1010
"test": "npm run lint && ng test --configuration=test",
11-
"lint": "ng lint",
11+
"lint": "npx ng lint angular-folder-structure",
1212
"e2e": "ng e2e",
1313
"watch": "ng test --configuration=test --browsers ChromeHeadless --watch",
1414
"build:prod": "ng build --configuration production --vendor-chunk",
@@ -69,11 +69,11 @@
6969
"devDependencies": {
7070
"@angular-devkit/build-angular": "~12.2.5",
7171
"@angular-devkit/core": "^12.2.5",
72-
"@angular-eslint/builder": "^12.0.0",
73-
"@angular-eslint/eslint-plugin": "^12.0.0",
74-
"@angular-eslint/eslint-plugin-template": "^12.0.0",
72+
"@angular-eslint/builder": "12.4.1",
73+
"@angular-eslint/eslint-plugin": "12.4.1",
74+
"@angular-eslint/eslint-plugin-template": "12.4.1",
7575
"@angular-eslint/schematics": "12.4.1",
76-
"@angular-eslint/template-parser": "^12.0.0",
76+
"@angular-eslint/template-parser": "12.4.1",
7777
"@angular/cli": "^12.2.5",
7878
"@angular/compiler-cli": "^12.2.5",
7979
"@angular/language-service": "^12.2.5",
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
2-
if (parentModule) {
3-
throw new Error(`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`);
4-
}
5-
}
2+
if (parentModule) {
3+
throw new Error(
4+
`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`
5+
);
6+
}
7+
}

src/app/core/logger.service.spec.ts

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

src/app/core/logger.service.ts

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

src/app/data/service/json-api.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import data from './json/data.json';
66
providedIn: 'root'
77
})
88
export class JsonApiService {
9-
109
get(url: string): Observable<any> {
1110
switch (url) {
1211
case '/projects':
1312
return of(data.projects);
14-
default:
13+
default:
1514
const id = url.substring(url.lastIndexOf('/') + 1);
1615
return of(data.projects[id]);
1716
}

src/app/layout/content-layout/content-layout.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { ThemeService } from '@core/service/theme.service';
1313
export class ContentLayoutComponent implements OnInit {
1414
currentTheme: string;
1515

16-
private overlayContainer: OverlayContainer;
17-
1816
currentActiveTheme$ = this.themeService.getDarkTheme().pipe(
1917
map((isDarkTheme: boolean) => {
2018
const [lightTheme, darkTheme] = themes;
@@ -37,6 +35,8 @@ export class ContentLayoutComponent implements OnInit {
3735
})
3836
);
3937

38+
private overlayContainer: OverlayContainer;
39+
4040
constructor(private themeService: ThemeService) {}
4141

4242
ngOnInit(): void {

src/app/modules/auth/page/login/login.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ export class LoginComponent implements OnInit, OnDestroy {
4848
.subscribe();
4949
}
5050

51+
ngOnDestroy(): void {
52+
this.sub.unsubscribe();
53+
}
54+
5155
private buildForm(): void {
5256
this.loginForm = this.formBuilder.group({
5357
username: ['', Validators.required],
5458
password: ['', Validators.required]
5559
});
5660
}
57-
58-
ngOnDestroy(): void {
59-
this.sub.unsubscribe();
60-
}
6161
}

src/app/modules/contact/contact-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ const routes: Routes = [
88
}
99
];
1010

11-
export const ContactRoutes = RouterModule.forChild(routes);
11+
export const contactRoutes = RouterModule.forChild(routes);
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import { NgModule } from '@angular/core';
22

33
import { SharedModule } from '@shared/shared.module';
4-
import { ContactRoutes } from './contact-routing.module';
4+
import { contactRoutes } from './contact-routing.module';
55
import { ContactComponent } from './page/contact/contact.component';
66

7-
87
@NgModule({
98
declarations: [ContactComponent],
10-
imports: [
11-
ContactRoutes,
12-
13-
SharedModule
14-
]
9+
imports: [contactRoutes, SharedModule]
1510
})
16-
export class ContactModule { }
11+
export class ContactModule {}

src/environments/environment.prod.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ export const environment = {
55
production: true,
66
version: env.npm_package_version,
77
serverUrl: '/api',
8-
envName: 'PROD',
9-
API_URL: 'assets/api'
8+
envName: 'PROD'
109
};

src/environments/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export const environment = {
99
production: false,
1010
version: env.npm_package_version + '-dev',
1111
serverUrl: '/api',
12-
envName: 'DEV',
13-
API_URL: 'assets/api'
12+
envName: 'DEV'
1413
};
1514

1615
/*

0 commit comments

Comments
 (0)