Skip to content

Commit

Permalink
turn on no confusing non null assertions rule on
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 authored and kcinay055679 committed Dec 20, 2024
1 parent d90865a commit 22c7da3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export default tsEslint.config(
'@angular-eslint/component-class-suffix': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@stylistic/no-extra-parens': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
'@stylistic/no-extra-parens': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
//Delete these rules after fixing all the issues and enabling the actual rules
'@stylistic/quotes': 'off',
'@stylistic/function-call-argument-newline': 'off',
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/shared/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export function getValueFromQuery (query: any, fallback?: number): number[] {
const values = Array.from([query])
.flat()
.filter((e) => e !== "")
.map((e) => (typeof e == 'string' ? e.split(',') : e))
.map((e) => {
return typeof e == 'string' ? e.split(',') : e;
})
.flat()
.map((id: any) => Number(id))
.filter((id: number) => Number.isInteger(id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ describe("ScoringComponent",
component.commitPercent = 0;
component.failPercent = 0;

// Set zone
(component.keyResult.lastCheckIn as CheckInOrdinalMin)!.zone! = object.zoneValue;
// Set zonen
(component.keyResult.lastCheckIn as CheckInOrdinalMin).zone = object.zoneValue;
component.calculatePercentageOrdinal();

// Verify if percentage was set correctly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class ObjectiveFormComponent implements OnInit, OnDestroy {
{
objective: objectiveDTO,
keyResults: this.keyResults
.filter((keyResult, index) => (this.objectiveForm.value.keyResults ? this.objectiveForm.value.keyResults[index] : false))
.filter((keyResult, index) => this.objectiveForm.value.keyResults?.[index] ?? false)
.map((result) => ({
...result,
id: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class SearchTeamManagementComponent {
.pipe(
takeUntilDestroyed(),
debounceTime(200),
map((v) => (v ? v.trim() : '')),
map((v) => (v ?? "").trim()),
distinctUntilChanged()
)
.subscribe((searchValue) => {
Expand Down

0 comments on commit 22c7da3

Please sign in to comment.