Skip to content

Commit

Permalink
Align configuration with new Angular project
Browse files Browse the repository at this point in the history
  • Loading branch information
devoto13 committed Jan 9, 2023
1 parent 63391de commit c8ef757
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 51 deletions.
12 changes: 0 additions & 12 deletions projects/demo/.browserslistrc

This file was deleted.

4 changes: 2 additions & 2 deletions projects/demo/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h3>Animation</h3>
<fa-icon [icon]="faSync" [spin]="isSyncAnimated" (click)="isSyncAnimated = !isSyncAnimated"></fa-icon>
<p>Slide to turn up the magic.</p>
<fa-icon [icon]="faMagic" transform="rotate-{{ magicLevel }}"></fa-icon>
<input type="range" [value]="magicLevel" (input)="magicLevel = $event.target.value" />
<input type="range" [value]="magicLevel" (input)="magicLevel = $any($event.target).value" />

<h3>Stack</h3>
<p>Stack multiple icons into one.</p>
Expand Down Expand Up @@ -90,7 +90,7 @@ <h3>Layers</h3>
[min]="1000"
[max]="2000"
[value]="notificationsCounter"
(input)="notificationsCounter = $event.target.value"
(input)="notificationsCounter = $any($event.target).value"
/>
</div>
<div class="selection">
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class AppComponent {
isSyncAnimated = true;
magicLevel = 0;

selectedPosition: string;
selectedPosition: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';

constructor(library: FaIconLibrary, faConfig: FaConfig) {
// Notice that we're adding two different icon objects to the library.
Expand Down
12 changes: 0 additions & 12 deletions projects/demo/tsconfig.app-ve.json

This file was deleted.

3 changes: 2 additions & 1 deletion src/lib/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export class FaIconComponent implements OnChanges {

ngOnChanges(changes: SimpleChanges) {
if (this.icon == null && this.config.fallbackIcon == null) {
return faWarnIfIconSpecMissing();
faWarnIfIconSpecMissing();
return;
}

if (changes) {
Expand Down
6 changes: 2 additions & 4 deletions src/lib/shared/utils/normalize-icon-spec.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ export const faNormalizeIconSpec = (
return iconSpec;
}

if (Array.isArray(iconSpec) && (iconSpec as string[]).length === 2) {
return { prefix: iconSpec[0], iconName: iconSpec[1] };
}

if (typeof iconSpec === 'string') {
return { prefix: defaultPrefix, iconName: iconSpec };
}

return { prefix: iconSpec[0], iconName: iconSpec[1] };
};
29 changes: 20 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,34 @@
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"strictNullChecks": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"module": "es2020",
"moduleResolution": "node",
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"strict": true,
"strictPropertyInitialization": false,
"strictNullChecks": false,
"module": "ES2022",
"useDefineForClassFields": false,
"lib": ["ES2022", "dom"],
"stripInternal": true,
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
"paths": {
"@fortawesome/angular-fontawesome": ["dist/angular-fontawesome"],
"@fortawesome/angular-fontawesome/testing": ["dist/angular-fontawesome/testing"]
},
"useDefineForClassFields": false
}
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
12 changes: 2 additions & 10 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/lib",
"declarationMap": true,
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
"types": []
},
"exclude": ["src/testing/*.ts", "src/test.ts", "**/*.spec.ts"]
}

0 comments on commit c8ef757

Please sign in to comment.