Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint rules and refactoring types. #2676

Merged

Conversation

miettal
Copy link
Contributor

@miettal miettal commented Jun 22, 2024

  1. banned using Object, Function types
  2. refactor .eslintrc

Copy link

Code Coverage

@sfeilmeier sfeilmeier requested a review from lukasrgr June 24, 2024 06:58
"@stylistic/quote-props": [
"warn",
"consistent"
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you fix formatting, why did you change the order around?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clear rule cateogry. I commented on this commit.
4a1365c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,i agree

@@ -126,7 +126,7 @@ export class Service extends AbstractService {
// this.notify(notification);
}

public setCurrentComponent(currentPageTitle: string | { languageKey: string, interpolateParams?: Object }, activatedRoute: ActivatedRoute): Promise<Edge> {
public setCurrentComponent(currentPageTitle: string | { languageKey: string, interpolateParams?: {} }, activatedRoute: ActivatedRoute): Promise<Edge> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{} is better than Object but still not good, anyway this method is deprecated and shouldnt be used in the future anyway

"{}": false,
"Object": false,
"Function": false
"{}": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would ban empty object as well, otherwise, type safety is not guaranteed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I want to ban {}. but in this repo there are using many {} type. especially {} used in json rpc related type. this means if I remove {} in this repo, this will be super heavy task(Many typing will needed....). so I focused to ban Object and Function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reducing any type and banning {}, applying strictNullChecks is very very important...
if I have time, I will address this kind little by little in other PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i understand in terms of being a heavy task, so i approve

Copy link
Contributor

@lukasrgr lukasrgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for your contribution 🚀

@lukasrgr lukasrgr requested a review from sfeilmeier June 26, 2024 12:19
@sfeilmeier sfeilmeier merged commit f130325 into OpenEMS:develop Jun 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants