Skip to content

Commit c8ef757

Browse files
committed
Align configuration with new Angular project
1 parent 63391de commit c8ef757

File tree

8 files changed

+29
-51
lines changed

8 files changed

+29
-51
lines changed

projects/demo/.browserslistrc

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

projects/demo/src/app/app.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h3>Animation</h3>
4242
<fa-icon [icon]="faSync" [spin]="isSyncAnimated" (click)="isSyncAnimated = !isSyncAnimated"></fa-icon>
4343
<p>Slide to turn up the magic.</p>
4444
<fa-icon [icon]="faMagic" transform="rotate-{{ magicLevel }}"></fa-icon>
45-
<input type="range" [value]="magicLevel" (input)="magicLevel = $event.target.value" />
45+
<input type="range" [value]="magicLevel" (input)="magicLevel = $any($event.target).value" />
4646

4747
<h3>Stack</h3>
4848
<p>Stack multiple icons into one.</p>
@@ -90,7 +90,7 @@ <h3>Layers</h3>
9090
[min]="1000"
9191
[max]="2000"
9292
[value]="notificationsCounter"
93-
(input)="notificationsCounter = $event.target.value"
93+
(input)="notificationsCounter = $any($event.target).value"
9494
/>
9595
</div>
9696
<div class="selection">

projects/demo/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class AppComponent {
4848
isSyncAnimated = true;
4949
magicLevel = 0;
5050

51-
selectedPosition: string;
51+
selectedPosition: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
5252

5353
constructor(library: FaIconLibrary, faConfig: FaConfig) {
5454
// Notice that we're adding two different icon objects to the library.

projects/demo/tsconfig.app-ve.json

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

src/lib/icon/icon.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export class FaIconComponent implements OnChanges {
101101

102102
ngOnChanges(changes: SimpleChanges) {
103103
if (this.icon == null && this.config.fallbackIcon == null) {
104-
return faWarnIfIconSpecMissing();
104+
faWarnIfIconSpecMissing();
105+
return;
105106
}
106107

107108
if (changes) {

src/lib/shared/utils/normalize-icon-spec.util.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ export const faNormalizeIconSpec = (
1212
return iconSpec;
1313
}
1414

15-
if (Array.isArray(iconSpec) && (iconSpec as string[]).length === 2) {
16-
return { prefix: iconSpec[0], iconName: iconSpec[1] };
17-
}
18-
1915
if (typeof iconSpec === 'string') {
2016
return { prefix: defaultPrefix, iconName: iconSpec };
2117
}
18+
19+
return { prefix: iconSpec[0], iconName: iconSpec[1] };
2220
};

tsconfig.json

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,34 @@
33
"compilerOptions": {
44
"baseUrl": "./",
55
"outDir": "./dist/out-tsc",
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"strictPropertyInitialization": false,
9+
"strictNullChecks": false,
10+
"noImplicitOverride": false,
11+
"noPropertyAccessFromIndexSignature": false,
12+
"noImplicitReturns": true,
13+
"noFallthroughCasesInSwitch": true,
614
"sourceMap": true,
715
"declaration": false,
8-
"module": "es2020",
9-
"moduleResolution": "node",
16+
"downlevelIteration": true,
1017
"experimentalDecorators": true,
18+
"moduleResolution": "node",
1119
"importHelpers": true,
1220
"target": "ES2022",
13-
"strict": true,
14-
"strictPropertyInitialization": false,
15-
"strictNullChecks": false,
21+
"module": "ES2022",
22+
"useDefineForClassFields": false,
23+
"lib": ["ES2022", "dom"],
1624
"stripInternal": true,
17-
"typeRoots": ["node_modules/@types"],
18-
"lib": ["es2017", "dom"],
1925
"paths": {
2026
"@fortawesome/angular-fontawesome": ["dist/angular-fontawesome"],
2127
"@fortawesome/angular-fontawesome/testing": ["dist/angular-fontawesome/testing"]
22-
},
23-
"useDefineForClassFields": false
28+
}
29+
},
30+
"angularCompilerOptions": {
31+
"enableI18nLegacyMessageIdFormat": false,
32+
"strictInjectionParameters": true,
33+
"strictInputAccessModifiers": true,
34+
"strictTemplates": true
2435
}
2536
}

tsconfig.lib.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "./out-tsc/lib",
5-
"declarationMap": true,
65
"declaration": true,
6+
"declarationMap": true,
77
"inlineSources": true,
8-
"types": [],
9-
"lib": ["dom", "es2018"]
10-
},
11-
"angularCompilerOptions": {
12-
"skipTemplateCodegen": true,
13-
"strictMetadataEmit": true,
14-
"fullTemplateTypeCheck": true,
15-
"strictInjectionParameters": true,
16-
"enableResourceInlining": true
8+
"types": []
179
},
1810
"exclude": ["src/testing/*.ts", "src/test.ts", "**/*.spec.ts"]
1911
}

0 commit comments

Comments
 (0)