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

[Issue 1232] Refactor NetworkModuleSigma PieChartModule TextModule JS #1246

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

trickroll
Copy link
Contributor

Addresses some, but not all, of the files referenced in issue #1232

Refactored "var" into const/let for:

  • NetworkModule_sigma.js
  • PieChartModule.js
  • TextModule.js

Please tell me if there is anything I may need to fix or change! Thank you and welcome the feedback.

@Corvince
Copy link
Contributor

Corvince commented Apr 4, 2022

Hi @trickroll and thanks for the contribution! I am not sure which rule you applied for deciding between let and const. Normally you should use const whenever possibly and only use let if it is not possible otherwise.

@trickroll
Copy link
Contributor Author

@Corvince Thank you for feedback! Let me revisit the const vs let. Apologies about the thrash and appreciate the patience. Understand that there are benefits to making variables immutable

@rht
Copy link
Contributor

rht commented Apr 5, 2022

Everything else looks good to me.
Make sure to:

@rht
Copy link
Contributor

rht commented Apr 5, 2022

If you want to programmatically catch these reassignment errors, you can use eslint.
After installing, you need to create .eslintrc.js in the root of your Git repo, containing this:

module.exports = {
    "env": {
        "browser": true,
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 12
    },
    "rules": {
    }
};

It should tell you this error if you specify svg_tag as const while doing the +=:

15:5   error  'svg_tag' is constant                                no-const-assign

Pinging @SangameshItagi because this info is useful for him as well.

@trickroll
Copy link
Contributor Author

@rht - Thank you for your guidance and support! Makes a huge difference for a beginner :)

@rht
Copy link
Contributor

rht commented Apr 5, 2022

LGTM

@rht rht merged commit 04aca59 into projectmesa:main Apr 5, 2022
@rht
Copy link
Contributor

rht commented Apr 5, 2022

Merged, thank you!

@trickroll trickroll deleted the jsRefactor branch April 6, 2022 01:12
@rht rht mentioned this pull request Apr 16, 2022
@jackiekazil jackiekazil added this to the Quartzsite (next release) milestone Jun 15, 2022
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.

None yet

4 participants