because-why-not / awrtc_signaling

BSD 3-Clause "New" or "Revised" License
25 stars 25 forks source link

Lint and remove unused code #7

Open OverLucker opened 3 years ago

OverLucker commented 3 years ago

Looks like the code is not used at all

https://github.com/because-why-not/awrtc_signaling/blob/dc8f76ed502a0aab50496da82e35287813e534d6/INetwork.ts#L88

https://github.com/because-why-not/awrtc_signaling/blob/dc8f76ed502a0aab50496da82e35287813e534d6/INetwork.ts#L268

https://github.com/because-why-not/awrtc_signaling/blob/dc8f76ed502a0aab50496da82e35287813e534d6/INetwork.ts#L322

https://github.com/because-why-not/awrtc_signaling/blob/dc8f76ed502a0aab50496da82e35287813e534d6/INetwork.ts#L348

Also that would be great, if code had been performed in uniform style

devluz commented 3 years ago

Can you recommend a good tool to ensure a uniform code style?

As for the unused code: The INetwork.ts is used in other projects as well. We can't really change it independently yet without a lot of code duplication. It would probably need an awrtc_common for anything that is shared between client, server and external applications. I keep this open though as a reminder.

OverLucker commented 3 years ago

That one will be sufficient

https://eslint.org/

In my project, I ended up with this config

{
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "google"
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaVersion": 12
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
        "indent": ["error", 4],
        "max-len": ["warn", 120],
        "require-jsdoc": "warn"
    }
}