Skip to content

Commit b122987

Browse files
author
bcsik
committed
add prettier and apply stricter typescript
1 parent 04ac0a5 commit b122987

28 files changed

+529
-139
lines changed

.eslintrc.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
],
1111
"extends": [
1212
"eslint:recommended",
13-
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/strict",
1414
"plugin:@angular-eslint/recommended",
15-
"plugin:@angular-eslint/template/process-inline-templates"
15+
"plugin:@angular-eslint/template/process-inline-templates",
16+
"plugin:prettier/recommended"
1617
],
1718
"rules": {
1819
"@angular-eslint/directive-selector": [
@@ -39,7 +40,8 @@
3940
],
4041
"extends": [
4142
"plugin:@angular-eslint/template/recommended",
42-
"plugin:@angular-eslint/template/accessibility"
43+
"plugin:@angular-eslint/template/accessibility",
44+
"plugin:prettier/recommended"
4345
],
4446
"rules": {}
4547
}

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": false,
3+
"overrides": [
4+
{
5+
"files": "*.html",
6+
"options": {
7+
"parser": "angular"
8+
}
9+
}
10+
]
11+
}

package-lock.json

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,21 @@
3333
"@angular-eslint/template-parser": "17.2.1",
3434
"@angular/cli": "^17.2.0",
3535
"@angular/compiler-cli": "^17.2.0",
36+
"@angular/localize": "^17.2.1",
3637
"@types/jasmine": "~5.1.0",
3738
"@typescript-eslint/eslint-plugin": "6.19.0",
3839
"@typescript-eslint/parser": "6.19.0",
3940
"eslint": "^8.56.0",
41+
"eslint-config-prettier": "^9.1.0",
42+
"eslint-plugin-prettier": "^5.1.3",
4043
"jasmine-core": "~5.1.0",
4144
"karma": "~6.4.0",
4245
"karma-chrome-launcher": "~3.2.0",
4346
"karma-coverage": "~2.2.0",
4447
"karma-jasmine": "~5.1.0",
4548
"karma-jasmine-html-reporter": "~2.1.0",
49+
"ng-mocks": "^14.12.1",
50+
"prettier": "^3.2.5",
4651
"typescript": "~5.3.2"
4752
}
4853
}

src/app/app.component.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { TestBed } from '@angular/core/testing';
2-
import { AppComponent } from './app.component';
1+
import { TestBed } from '@angular/core/testing'
2+
import { AppComponent } from './app.component'
33

44
describe('AppComponent', () => {
55
beforeEach(async () => {
66
await TestBed.configureTestingModule({
77
imports: [AppComponent],
8-
}).compileComponents();
9-
});
8+
}).compileComponents()
9+
})
1010

1111
it('should create the app', () => {
12-
const fixture = TestBed.createComponent(AppComponent);
13-
const app = fixture.componentInstance;
14-
expect(app).toBeTruthy();
15-
});
16-
});
12+
const fixture = TestBed.createComponent(AppComponent)
13+
const app = fixture.componentInstance
14+
expect(app).toBeTruthy()
15+
})
16+
})

src/app/app.component.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import { Component } from '@angular/core';
2-
import { RouterOutlet } from '@angular/router';
3-
import {MenuItem} from "primeng/api";
4-
import {MenubarModule} from "primeng/menubar";
1+
import { Component } from '@angular/core'
2+
import { RouterOutlet } from '@angular/router'
3+
import { MenuItem } from 'primeng/api'
4+
import { MenubarModule } from 'primeng/menubar'
55

66
@Component({
77
selector: 'app-root',
88
standalone: true,
99
imports: [RouterOutlet, MenubarModule],
1010
templateUrl: './app.component.html',
11-
styleUrl: './app.component.css'
11+
styleUrl: './app.component.css',
1212
})
1313
export class AppComponent {
1414
protected readonly model: MenuItem[] = [
1515
{
1616
label: 'Video',
17-
routerLink: 'video'
17+
routerLink: 'video',
1818
},
1919
{
2020
label: 'Event',
21-
routerLink: 'event'
21+
routerLink: 'event',
2222
},
2323
{
2424
label: 'Member',
25-
routerLink: 'member'
26-
}
25+
routerLink: 'member',
26+
},
2727
]
2828
}

src/app/app.config.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { ApplicationConfig } from '@angular/core';
2-
import { provideRouter } from '@angular/router';
1+
import { ApplicationConfig } from '@angular/core'
2+
import { provideRouter } from '@angular/router'
33

4-
import { routes } from './app.routes';
4+
import { routes } from './app.routes'
5+
import { provideHttpClient } from '@angular/common/http'
56

67
export const appConfig: ApplicationConfig = {
7-
providers: [provideRouter(routes)]
8-
};
8+
providers: [provideRouter(routes), provideHttpClient()],
9+
}

0 commit comments

Comments
 (0)