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

Track of ESLint Ignored Rules #534

Open
fatadel opened this issue Sep 23, 2021 · 8 comments
Open

Track of ESLint Ignored Rules #534

fatadel opened this issue Sep 23, 2021 · 8 comments
Labels
bug Something isn't working td-tools Issues with axillary tools for node-wot

Comments

@fatadel
Copy link
Contributor

fatadel commented Sep 23, 2021

This issue is created to keep track of ignored eslint rules with respective justifications.

  1. File/Line: https://github.com/eclipse/thingweb.node-wot/blob/master/packages/td-tools/src/thing-description.ts
    Ignored Rule: no-use-before-define
    Reason: Many circular dependencies where interface/type/class A uses interface/type/class B in its definition and interface/type/class B uses interface/type/class A in its definition.

  2. File/Line: https://github.com/eclipse/thingweb.node-wot/blob/master/packages/td-tools/src/thing-description.ts
    Ignored Rule: eslint-disable-next-line @typescript-eslint/no-explicit-any
    Reason: TD class should be replaced by autogenerated one (see Clean-up of TS definitions in thing-description.ts #529)

  3. CoAP, see 9270d48

  4. Netconf, see disabled warnings in disable eslint warnings #818

@relu91 relu91 added td-tools Issues with axillary tools for node-wot bug Something isn't working labels Oct 5, 2021
@relu91
Copy link
Member

relu91 commented Oct 22, 2021

from @danielpeintner in #589

Note: I had to disable rules.. I did not manage to solve them ... for example not using any

cli.ts
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-var-requires

cli-default-servient.ts
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types

@relu91
Copy link
Member

relu91 commented Oct 27, 2021

From the PR linked right above:
packages/binding-mbus/src/mbus-connection.ts

// eslint-disable-next-line @typescript-eslint/no-var-requires
const MbusMaster = require("node-mbus");

@JKRhb
Copy link
Member

JKRhb commented Mar 16, 2022

If I see it correctly, we are targeting ES6 with the TS transpiler at the moment, right? Then I think we could actually disable the rule no-use-before-define completely which apparently is only relevant if a JavaScript version prior to ES6 is used at the transpile target (see https://eslint.org/docs/rules/no-use-before-define).

@JKRhb
Copy link
Member

JKRhb commented Mar 16, 2022

3. CoAP, see [9270d48](https://github.com/eclipse/thingweb.node-wot/commit/9270d48e9ce12a16f5be77dd9025f797bd03765d)

This point has actually been resolved in the meantime, by the way :)

@danielpeintner
Copy link
Member

This point has actually been resolved in the meantime, by the way :)

I have striked through it

@danielpeintner
Copy link
Member

If I see it correctly, we are targeting ES6 with the TS transpiler at the moment, right? Then I think we could actually disable the rule no-use-before-define completely which apparently is only relevant if a JavaScript version prior to ES6 is used at the transpile target (see https://eslint.org/docs/rules/no-use-before-define).

ES6 dates back to ECMAScript 2015.
Hence I think this is okay.

@relu91 any opinion?

BTW, I noticed that in .prettierrc.json we still use es5. Shall we change that too?
see https://github.com/eclipse/thingweb.node-wot/search?q=ES5

@relu91
Copy link
Member

relu91 commented Mar 18, 2022

ES6 dates back to ECMAScript 2015.
Hence I think this is okay.

Good point, but I think is still a good practice to define stuff before using them (i.e. classes types etc. ). So I would be ok for leaving the rule as it is, but I would not stop you if you think differently :)

BTW, I noticed that in .prettierrc.json we still use es5. Shall we change that too?
see https://github.com/eclipse/thingweb.node-wot/search?q=ES5

Yeah, I think we should.

@JKRhb
Copy link
Member

JKRhb commented Mar 18, 2022

ES6 dates back to ECMAScript 2015.
Hence I think this is okay.

Good point, but I think is still a good practice to define stuff before using them (i.e. classes types etc. ). So I would be ok for leaving the rule as it is, but I would not stop you if you think differently :)

Oh, yeah, you are right, I meant only typescript related definitions with the no-use-before-define rule :) I just noticed that there is a typescript-specific rule in @typescript-eslint that can be used instead of the default so we can actually get rid of the false positives (see here). I would open a PR for this shortly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working td-tools Issues with axillary tools for node-wot
Projects
None yet
Development

No branches or pull requests

4 participants