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

refactor(coap): fix eslint issues #588

Merged
merged 2 commits into from
Oct 20, 2021

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Oct 19, 2021

This PR fixes a number of eslint issues in the binding-coap package (also see #586). Due to the fact that are no typescript bindings for node-coap yet some any typings couldn't be removed yet. However, with the next version of node-coap and the merge of #538 this will hopefully also be resolved eventually.

I opened this PR as a draft for now due to some tests that failed locally. The issues should be fixed now :)

@JKRhb JKRhb force-pushed the coap-eslint branch 3 times, most recently from 46a8ae1 to 71848cf Compare October 19, 2021 16:32
@JKRhb JKRhb marked this pull request as ready for review October 19, 2021 16:33
Copy link
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

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

Does it make sense to add

// eslint-disable-next-line @typescript-eslint/no-explicit-any

before the any warnings and note down the files in
#534

I know we are somewhat cheating but I guess as long as we keep track of the ignored rules it is fine and we can check from time to time whether more ignored rules can be resolved...

@danielpeintner
Copy link
Member

danielpeintner commented Oct 20, 2021

Note: running npm run lint shows 12 warnings.
Maybe it makes sense to switch off @typescript-eslint/no-explicit-any for those 2 files entirely by adding
/* eslint-disable @typescript-eslint/no-explicit-any */ at the top of the file

C:\...\thingweb.node-wot\packages\binding-coap\src\coap-client.ts
   43:20  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
   44:36  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
   63:38  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
   88:46  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  133:38  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  154:38  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  237:97  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

C:\...\thingweb.node-wot\packages\binding-coap\src\coap-server.ts
   36:30  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
   36:60  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
   36:70  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  200:32  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  200:42  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 12 problems (0 errors, 12 warnings)

@relu91
Copy link
Member

relu91 commented Oct 20, 2021

In my understanding, once we have #538 ready to go, we will have also typings for those any variables. So I would keep the warning if you don't really mind. I guess your concerns are for the CI red flags, right?

@JKRhb
Copy link
Member Author

JKRhb commented Oct 20, 2021

In my understanding, once we have #538 ready to go, we will have also typings for those any variables.

Exactly, I hope that the new version of node-coap is going to be ready soon (unfortunately, the release process is a bit delayed at the moment). Therefore, I would tend to keep the warnings as temporary reminders as well but I can also add the ignore statements if you prefer them, @danielpeintner.

This is a temporary workaround until eclipse-thingweb#538
is ready.
@danielpeintner
Copy link
Member

I guess your concerns are for the CI red flags, right?

Yes :-)

Either way is fine!

@JKRhb
Copy link
Member Author

JKRhb commented Oct 20, 2021

I now added a commit for explicitly ignoring the anys which can hopefully be removed soon :)

@danielpeintner
Copy link
Member

I now added a commit for explicitly ignoring the anys which can hopefully be removed soon :)

Thanks, I added it to #534

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