Skip to content

Commit

Permalink
build: ajustes necessários por conta do lint
Browse files Browse the repository at this point in the history
Atualiza projeto para o angular 17@next.

fixes DTHFUI-8041
  • Loading branch information
CSimoesJr committed Dec 16, 2023
1 parent f2e4ce2 commit d5b1f7d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 15 deletions.
13 changes: 11 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"plugins": ["sonarjs", "eslint-plugin-react"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-array-constructor": "off",
"@angular-eslint/component-selector": [
"error",
{
Expand Down Expand Up @@ -126,6 +130,11 @@
"format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "import",
"format": ["camelCase", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "classProperty",
"format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { RouterTestingModule } from '@angular/router/testing';

import { PoPageLoginPopoverComponent } from './po-page-login-popover.component';

import * as UtilFunctions from './../../../utils/util';
import { PoI18nPipe } from './../../../../../../ui/src/lib/services/po-i18n/po-i18n.pipe';

describe('ThPageLoginPopoverComponent: ', () => {
Expand Down
12 changes: 11 additions & 1 deletion projects/ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "**/util-expect.spec.ts"],
"overrides": [
{
"files": ["*.ts"],
Expand All @@ -9,6 +9,14 @@
"createDefaultProgram": true
},
"plugins": ["sonarjs", "eslint-plugin-react"],
"excludedFiles": [
"test.ts",
"**/*.spec.ts",
"**/*.e2e-spec.ts",
"**/*.po.ts",
"./node_modules/",
"./projects/ui/src/lib/util-test/util-expect.spec.ts"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
Expand All @@ -19,6 +27,8 @@
}
],
"@angular-eslint/directive-class-suffix": "off",
"@angular-eslint/no-host-metadata-property": "off",
"prefer-spread": "off",
"@angular-eslint/directive-selector": [
"error",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
],
providers: [SampleDashboardService]
})
export class SamplePoContainerDashboardComponent implements AfterContentChecked {
export class SamplePoContainerDashboardComponent implements AfterContentChecked, OnInit {
@ViewChild('formShare', { static: true }) formShare: NgForm;
@ViewChild(PoModalComponent) poModal: PoModalComponent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input } from '@angular/core';

import { PoGaugeCoordinates } from '../../interfaces/po-gauge-coordinates.interface';

@Component({
selector: '[po-gauge-path]',
templateUrl: './po-gauge-path.component.svg'
})
export class PoGaugePathComponent implements OnInit {
export class PoGaugePathComponent {
@Input('p-base-coordinates') baseCoordinates: PoGaugeCoordinates;

@Input('p-ranges-coordinates') rangesCoordinates: Array<PoGaugeCoordinates>;

constructor() {}

ngOnInit(): void {}

trackBy(index) {
return index;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class SamplePoMenuLabsComponent implements OnInit {
label: string;
link: string;
logo: string;
maxBadgeValue = 99999999999999999999;
maxBadgeValue = 999999999999999;
menuItems: Array<PoMenuItem>;
menuItemSelected: string;
menuParams: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core';

import { PoProgressBaseComponent } from './po-progress-base.component';
import { PoProgressStatus } from './enums/po-progress-status.enum';
Expand Down Expand Up @@ -29,7 +29,7 @@ import { poProgressLiterals } from './literals/po-progress.literals';
templateUrl: './po-progress.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PoProgressComponent extends PoProgressBaseComponent {
export class PoProgressComponent extends PoProgressBaseComponent implements OnInit {
language;
literals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { InputRequired } from './input-required.decorator';
})
class PoMockComponent implements OnInit {
@InputRequired() myProperty: any;
ngOnInit() {}
ngOnInit() {
let a;
}
}

describe('InputRequired:', () => {
Expand Down
4 changes: 2 additions & 2 deletions projects/ui/src/lib/utils/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1407,8 +1407,8 @@ describe('Function convertNumberToDecimals:', () => {
it('should convert number to float', () => {
expect(convertNumberToDecimal(12.567, 2)).toBe(12.57);
expect(convertNumberToDecimal(12.56, 2)).toBe(12.56);
expect(convertNumberToDecimal(12.5649584958748574897, 2)).toBe(12.56);
expect(convertNumberToDecimal(12.5649584958748574897, 4)).toBe(12.565);
expect(convertNumberToDecimal(12.564958495874857, 2)).toBe(12.56);
expect(convertNumberToDecimal(12.564958495874857, 4)).toBe(12.565);
expect(convertNumberToDecimal(12.56, 1)).toBe(12.6);
expect(convertNumberToDecimal('12.56', 1)).toBe(12.6);
expect(convertNumberToDecimal('12', 1)).toBe(12);
Expand Down

0 comments on commit d5b1f7d

Please sign in to comment.