Skip to content

Commit

Permalink
apply prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Dec 13, 2024
1 parent 1b1712f commit 995ec42
Show file tree
Hide file tree
Showing 24 changed files with 181 additions and 182 deletions.
8 changes: 4 additions & 4 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
21 changes: 10 additions & 11 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Build:

## Formatting


We use **EsLint** and a variety of plugins to format html and ts files:
https://eslint.org/

Expand All @@ -48,16 +47,16 @@ Open the html file in browser and you get a beautiful overview
## Cypress Tests

- local setup
- start local Docker `docker-compose up`
- start local Server: `OkrApplication-E2E`
- start local Client: `npm run start`
- start local Docker `docker-compose up`
- start local Server: `OkrApplication-E2E`
- start local Client: `npm run start`
- run selected Tests
- npm run `npm run cypress:open`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- npm run `npm run cypress:open`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- run all tests
- npm run `npm run cypress:run`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- npm run `npm run cypress:run`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- in case of failing Tests:
- stop and restart local Server
- stop and restart local Client
- re-run Cypress Tests
- stop and restart local Server
- stop and restart local Client
- re-run Cypress Tests
194 changes: 97 additions & 97 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,107 +7,107 @@ import angular from 'angular-eslint'
import angularTemplateParser from '@angular-eslint/template-parser'

export default tsEslint.config(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
...stylistic.configs['all-flat'].rules,
'unused-imports/no-unused-imports': 'error',
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
...stylistic.configs['all-flat'].rules,
'unused-imports/no-unused-imports': 'error',

// ToDo: Disable rules so eslint passes, fix in followup ticket
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'prefer-rest-params': 'off',
'@typescript-eslint/no-empty-function': ['off'],
'@stylistic/lines-around-comment': ['off'],
'@angular-eslint/no-empty-lifecycle-method': 'off',
'@angular-eslint/component-class-suffix': 'off',
'@angular-eslint/template/eqeqeq': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@stylistic/no-extra-parens': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
//Delete these rules after fixing all the issues and enabling the actual rules
'@stylistic/quotes': 'off',
'@stylistic/function-call-argument-newline': 'off',
// ToDo: Disable rules so eslint passes, fix in followup ticket
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'prefer-rest-params': 'off',
'@typescript-eslint/no-empty-function': ['off'],
'@stylistic/lines-around-comment': ['off'],
'@angular-eslint/no-empty-lifecycle-method': 'off',
'@angular-eslint/component-class-suffix': 'off',
'@angular-eslint/template/eqeqeq': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@stylistic/no-extra-parens': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
//Delete these rules after fixing all the issues and enabling the actual rules
'@stylistic/quotes': 'off',
'@stylistic/function-call-argument-newline': 'off',

//Actual formatting rules
// '@stylistic/function-call-argument-newline': ['error', 'never'],
// '@stylistic/quotes': ['error', 'double'],
'@stylistic/padded-blocks': ['error', 'never'],
'@stylistic/dot-location': ['error', 'property'],
'@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/semi-style': ['error'],
'@stylistic/function-paren-newline': ['error', { minItems: 4 }],
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
// reenable this after fixing all the directives
// prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
//Actual formatting rules
// '@stylistic/function-call-argument-newline': ['error', 'never'],
// '@stylistic/quotes': ['error', 'double'],
'@stylistic/padded-blocks': ['error', 'never'],
'@stylistic/dot-location': ['error', 'property'],
'@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/semi-style': ['error'],
'@stylistic/function-paren-newline': ['error', { minItems: 4 }],
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
// reenable this after fixing all the directives
// prefix: 'app',
style: 'camelCase',
},
},
{
files: ['**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'prefer-rest-params': 'off',
'@typescript-eslint/no-empty-function': 'off',
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
processor: angular.processInlineTemplates,
languageOptions: {
parser: angularTemplateParser,
},
rules: {
...html.configs.recommended.rules,
// ToDo: Disable rules so eslint passes, fix in followup ticket
'@html-eslint/require-img-alt': 'off',
'@html-eslint/element-newline': 'off',
'@angular-eslint/template/eqeqeq': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
'@angular-eslint/directive-selector': 'off',
'@angular-eslint/template/click-events-have-key-events': 'off',
//stylistic rules
'@html-eslint/indent': ['error', 2],
},
},
{
files: ['**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'prefer-rest-params': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
{
plugins: {
'unused-imports': unusedImports,
'@stylistic': stylistic,
'@html-eslint': html,
},
}
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
processor: angular.processInlineTemplates,
languageOptions: {
parser: angularTemplateParser,
},
rules: {
...html.configs.recommended.rules,
// ToDo: Disable rules so eslint passes, fix in followup ticket
'@html-eslint/require-img-alt': 'off',
'@html-eslint/element-newline': 'off',
'@angular-eslint/template/eqeqeq': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
'@angular-eslint/directive-selector': 'off',
'@angular-eslint/template/click-events-have-key-events': 'off',
//stylistic rules
'@html-eslint/indent': ['error', 2],
},
},
{
plugins: {
'unused-imports': unusedImports,
'@stylistic': stylistic,
'@html-eslint': html,
},
}
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

.header-content {
padding-left: 1.5rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

#topBarHeight {
height: $top-bar-height;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

.submit {
background-color: $pz-dark-blue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

:host {
flex: 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "custom_bootstrap";
@import 'custom_bootstrap';

.active {
border-left: #909090 1px solid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';
.key-result {
background-color: $soft-grey;
border: 1px solid $dark-grey-border;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

.objective {
max-width: 750px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "custom_bootstrap";
@import 'custom_bootstrap';

mat-dialog-content {
//scrollbar-gutter: stable both-edges;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/shared/custom/scoring/scoring.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.stretch-div {
width: 100%;
background-image: url("./../../../../assets/images/scoring-stars.svg");
background-image: url('./../../../../assets/images/scoring-stars.svg');
height: 21px;
margin-bottom: 3.5px;
}
Expand All @@ -57,7 +57,7 @@
}

.score-stretch {
background-image: url("../../../../assets/images/scoring-stars.svg");
background-image: url('../../../../assets/images/scoring-stars.svg');
}

.value-label {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/shared/sidepanel/sidepanel.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';
.sidebar__content {
padding: 32px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../style/variables";
@import '../style/variables';

.input-fields {
margin-bottom: 0.5rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "variables";
@import 'variables';

:host {
height: 40px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "variables";
@import 'variables';

:host {
padding-top: 2rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "variables";
@import 'variables';

.mat-column-icon {
width: 40px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../style/_variables.scss";
@import '../../../style/_variables.scss';

:host {
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../style/_variables.scss";
@import '../../../style/_variables.scss';

:host {
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../style/_variables.scss";
@import '../../../style/_variables.scss';

#okrBanner {
position: relative;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/style/custom_angular.components.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "variables";
@import 'variables';

.mdc-button {
border-radius: 0.5rem !important;
Expand Down Expand Up @@ -77,7 +77,7 @@ $scale-gap: 0.1;

@for $i from calc($scale-start / $scale-gap) through calc($scale-end / $scale-gap) {
$scale-value: $i * $scale-gap;
$selector: ".scale-#{$scale-value * 10}";
$selector: '.scale-#{$scale-value * 10}';

#{$selector} {
transform: scale(#{$scale-value}) !important;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/style/custom_angular.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@angular/material" as mat;
@import "_variables";
@import "custom_angular.components";
@use '@angular/material' as mat;
@import '_variables';
@import 'custom_angular.components';

$my-primary: mat.m2-define-palette($pz-dark-blue-palette, 500);
$my-accent: mat.m2-define-palette(mat.$m2-grey-palette, 900);
Expand Down
Loading

0 comments on commit 995ec42

Please sign in to comment.