Skip to content

Commit

Permalink
activate no non null asserted optional chain rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Dec 19, 2024
1 parent 114b64c commit 70be250
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export default tsEslint.config(
},
],
'prefer-rest-params': 'error',
'@typescript-eslint/no-empty-function': ['error', {allow: ['arrowFunctions', 'constructors']}],
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions', 'constructors'] }],
'@stylistic/lines-around-comment': ['error'],
'@angular-eslint/no-empty-lifecycle-method': 'error',
'@angular-eslint/component-class-suffix': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@stylistic/no-extra-parens': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
Expand All @@ -92,15 +92,15 @@ export default tsEslint.config(
// '@stylistic/quotes': ['error', 'double'],
'@stylistic/padded-blocks': ['error', 'never'],
'@stylistic/dot-location': ['error', 'property'],
'@stylistic/newline-per-chained-call': ['error', {ignoreChainWithDepth: 1}],
'@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 1 }],
'@stylistic/indent': ['error', 2],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/object-property-newline': ['error'],
'@stylistic/multiline-ternary': ['off'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/array-bracket-newline': ['error', {minItems: 4}],
'@stylistic/array-bracket-newline': ['error', { minItems: 4 }],
'@stylistic/semi-style': ['error'],
'@stylistic/function-paren-newline': ['error', {minItems: 4}],
'@stylistic/function-paren-newline': ['error', { minItems: 4 }],
'@angular-eslint/directive-selector': [
'error',
{
Expand Down Expand Up @@ -135,18 +135,25 @@ export default tsEslint.config(
files: ['**/*.html'],
extends: [
...angular.configs.templateRecommended,
// Add any other recommended configs here if needed
],
languageOptions: {
// Choose one parser. For Angular templates, usually angular.templateParser is needed.
parser: angular.templateParser,
},

rules: {
// Combine all sets of rules
...html.configs.recommended.rules,
...html.configs['flat/recommended'].rules,

'@angular-eslint/template/eqeqeq': 'error',
'@html-eslint/indent': ['error', 2],
'@html-eslint/require-img-alt': 'off',
'@html-eslint/require-img-alt': 'error',
'@html-eslint/require-closing-tags': ['error', { selfClosing: 'always' }],
'@angular-eslint/template/banana-in-box': 'error',
'@angular-eslint/template/no-negated-async': 'error',
//For Some reason the following rule does not work with the angular-parser
'@html-eslint/element-newline': 'off',
'@html-eslint/require-closing-tags': ['error', {selfClosing: 'always'}],
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class KeyresultDialogComponent {
objective: this.data.objective,
id: this.data.keyResult?.id } as KeyResultOrdinalDTO);
keyResult.id = this.data.keyResult?.id;
keyResult.version = this.data.keyResult?.version!;
keyResult.version = this.data.keyResult?.version;
keyResult.actionList = keyResult.actionList!.filter((action: Action) => action.action !== "");
this.keyResultService.saveKeyResult(keyResult)
.subscribe((returnValue) => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/shared/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function isLastCheckInNegative (baseline: number, stretchGoal: number, va
}

export function calculateCurrentPercentage (keyResultMetric: KeyResultMetricMin): number {
const value: number = +keyResultMetric.lastCheckIn?.value!;
const value: number = +keyResultMetric.lastCheckIn?.value;
const baseline: number = +keyResultMetric.baseline;
const stretchGoal: number = +keyResultMetric.stretchGoal;
if (isLastCheckInNegative(baseline,
Expand Down

0 comments on commit 70be250

Please sign in to comment.