From 2fdc5c6780f9d0dc74340e29b6a4c1e330260914 Mon Sep 17 00:00:00 2001 From: Nevio Di Gennaro Date: Thu, 19 Dec 2024 11:00:17 +0100 Subject: [PATCH] clean-up config and change from angular template rules with angularparser to html parser with html rules --- frontend/eslint.config.mjs | 42 ++++++++----------- .../check-in-form-ordinal.component.html | 18 ++++++-- .../keyresult-detail.component.html | 5 ++- .../objective-detail.component.html | 4 +- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 55a19b314a..9b7dd583ad 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -4,6 +4,7 @@ import unusedImports from 'eslint-plugin-unused-imports' import stylistic from '@stylistic/eslint-plugin' import html from '@html-eslint/eslint-plugin' import angular from 'angular-eslint' +import htmlParser from '@html-eslint/parser' export default tsEslint.config( { @@ -52,23 +53,25 @@ export default tsEslint.config( }, rules: { ...stylistic.configs['all-flat'].rules, + //eslint rules 'unused-imports/no-unused-imports': 'error', - - // ToDo: Disable rules so eslint passes, fix in followup ticket - '@typescript-eslint/no-unused-vars': [ + 'no-undef': 'error', + 'prefer-rest-params': 'error', + //Typescript eslint rules + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/no-unused-expressions': [ 'error', { - args: 'none', + allowTernary: true, }, ], - '@typescript-eslint/ban-ts-comment': 'error', - '@typescript-eslint/no-unused-expressions': [ + + '@typescript-eslint/no-unused-vars': [ 'error', { - allowTernary: true, + args: 'none', }, ], - 'no-undef': 'error', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-namespace': [ 'error', @@ -76,19 +79,15 @@ export default tsEslint.config( allowDeclarations: true, }, ], - 'prefer-rest-params': 'error', '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions', 'constructors'] }], - '@angular-eslint/no-empty-lifecycle-method': 'error', - '@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': 'error', '@typescript-eslint/no-confusing-non-null-assertion': 'error', - //Actual formatting rules + + //Stylistic eslint rules + '@stylistic/no-extra-parens': 'error', '@stylistic/function-call-argument-newline': ['error', 'never'], '@stylistic/quotes': ['error', 'double'], - // This rule makes no sense - '@stylistic/lines-around-comment': 'off', '@stylistic/padded-blocks': ['error', 'never'], '@stylistic/dot-location': ['error', 'property'], '@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 1 }], @@ -148,22 +147,15 @@ export default tsEslint.config( // recommended configuration included in the plugin ...html.configs['flat/recommended'], languageOptions: { - // Choose one parser. For Angular templates, usually angular.templateParser is needed. - parser: angular.templateParser, + parser: htmlParser, }, rules: { - // Combine all sets of rules - ...html.configs.recommended.rules, ...html.configs['flat/recommended'].rules, - //Angular template eslint rules - '@angular-eslint/template/eqeqeq': 'error', - '@angular-eslint/template/banana-in-box': 'error', - '@angular-eslint/template/no-negated-async': 'error', //Html eslint rules - '@html-eslint/require-img-alt': 'error', + '@html-eslint/require-img-alt': 'off', '@html-eslint/indent': ['error', 2], '@html-eslint/require-closing-tags': ['error', { selfClosing: 'always' }], - //For Some reason the following rule does not work with the angular-parser + //Doesn't work with Angular 17+ '@html-eslint/element-newline': 'off', }, { diff --git a/frontend/src/app/components/checkin/check-in-form-ordinal/check-in-form-ordinal.component.html b/frontend/src/app/components/checkin/check-in-form-ordinal/check-in-form-ordinal.component.html index a15793ca9b..99eec7cbc4 100644 --- a/frontend/src/app/components/checkin/check-in-form-ordinal/check-in-form-ordinal.component.html +++ b/frontend/src/app/components/checkin/check-in-form-ordinal/check-in-form-ordinal.component.html @@ -12,7 +12,8 @@ class="ordinal-zone" >
- Fail:  Commit / Target / Stretch noch nicht erreicht + Fail:  + Commit / Target / Stretch noch nicht erreicht
@@ -22,7 +23,10 @@ class="ordinal-zone" >
- Commit: {{ keyResult.commitZone }} + + Commit:  + {{ keyResult.commitZone }} +
@@ -32,7 +36,10 @@ class="ordinal-zone" >
- Target: {{ keyResult.targetZone }} + + Target:  + {{ keyResult.targetZone }} +
@@ -42,7 +49,10 @@ class="ordinal-zone" >
- Stretch: {{ keyResult.stretchZone }} + + Stretch:  + {{ keyResult.stretchZone }} +
diff --git a/frontend/src/app/components/keyresult-detail/keyresult-detail.component.html b/frontend/src/app/components/keyresult-detail/keyresult-detail.component.html index 67e37a0f76..d8f9c8109a 100644 --- a/frontend/src/app/components/keyresult-detail/keyresult-detail.component.html +++ b/frontend/src/app/components/keyresult-detail/keyresult-detail.component.html @@ -120,7 +120,10 @@

Action Plan

-
- {{ action.action }}
+
+ - + {{ action.action }} +
diff --git a/frontend/src/app/components/objective-detail/objective-detail.component.html b/frontend/src/app/components/objective-detail/objective-detail.component.html index f5ab9e9b1b..a8dc50cc5c 100644 --- a/frontend/src/app/components/objective-detail/objective-detail.component.html +++ b/frontend/src/app/components/objective-detail/objective-detail.component.html @@ -19,7 +19,9 @@

{{ objective.title }}

Beschrieb

-

-

+
+

-

+