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

Solve no-undef errors #1084

Closed
5 tasks
aashna27 opened this issue May 27, 2019 · 13 comments
Closed
5 tasks

Solve no-undef errors #1084

aashna27 opened this issue May 27, 2019 · 13 comments

Comments

@aashna27
Copy link

aashna27 commented May 27, 2019

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

To gain a sense of what the issue targets go to .eslintrc.js and comment the no-undef': 0 rule and the go to your terminal and run below command.

npx eslint .

You will see a list of no-undef errors and by this issue we plan to reduce those errors.

  • 📝 Update the following files
  1. ReplaceImage.js add const $ = window.$; at line 4 in ReplaceImage()
  2. Ui.js add const $ = window.$; at line 3 in CropModuleUi()
  3. Crop.js and modify line 20 as
-backgroundColor = options.backgroundColor.split(' ');
+var backgroundColor = options.backgroundColor.split(' ');
  1. Module.js and change line 7
-  getPixels = require('get-pixels');
+ var getPixels = require('get-pixels');
  1. Module.js and add as
function extraManipulation(pixels) {
+       const $ = window.$;
      var i = 0, sum = [0, 0, 0, 0];
  1. Module.js as
-r_data = pixels.get(i, j, 0);
+var r_data = pixels.get(i, j, 0),
r_new_data = (255 / r) * r_data;
pixels.set(i, j, 0, r_new_data);

-g_data = pixels.get(i, j, 1);
+var g_data = pixels.get(i, j, 1),
g_new_data = (255 / g) * g_data;
pixels.set(i, j, 1, g_new_data);

-b_data = pixels.get(i, j, 2);
+var b_data = pixels.get(i, j, 2),
b_new_data = (255 / b) * b_data;
pixels.set(i, j, 2, b_new_data);
  1. Convolution.js
-for (i = 0; i < 9; i++) {
+for(var i=0; i < 9; i++) {
    kernelValues[i] = Number(kernelValues[i]) * constantFactor;
  }
-for (y = 0; y < 3; y++) {
+for (var y = 0; y < 3; y++) {

-for (x = 0; x < 3; x++) {
+for(var x = 0; x < 3; x++) {
   

As explained similar changes can be made for many others files to bring down the number of errors (no-undef) for files SetInputStep, Module.js, and many others. The errors can be seen in the terminal using npx eslint . and similar changes can be made in files.

  • 💾 Commit your changes

  • 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • 🏁 Done Ask in comments for a review :)

Please keep us updated

💬⏰ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!

If this happens to you, don't sweat it! Grab another open issue.

Is someone else already working on this?

🔗- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.

👥- If someone seems stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

🤔❓ Questions?

Leave a comment below!

@sreekaransrinath
Copy link

Hey! I'd like to work on this issue :)

@harshkhandeparkar
Copy link
Member

Go ahead!

@sreekaransrinath
Copy link

sreekaransrinath commented May 28, 2019

Hey so there are three different Ui.js files, and two of them have a cropmoduleui function. Do I need to update both of them?

Similar issue with Module.js, there seem to be 20-odd different Module.js files

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented May 28, 2019 via email

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented May 28, 2019 via email

This was referenced May 28, 2019
@aashna27
Copy link
Author

@PoseidonSigmaX I have linked each file to their respective location, the links for each will take you to the required place.I hope I am making sense.

@sreekaransrinath
Copy link

sreekaransrinath commented May 31, 2019

@aashna27 In edit 6 you've placed a comma at the end of the lines to be added. I'm assuming you meant to put a semicolon there.

Also thank you for linking the files it was really confusing before

  • The file to edit for edit 7 isn't mentioned. Could you look into that please?

@aashna27
Copy link
Author

aashna27 commented Jun 3, 2019

@aashna27 In edit 6 you've placed a comma at the end of the lines to be added. I'm assuming you meant to put a semicolon there.

Also thank you for linking the files it was really confusing before

* The file to edit for edit 7 isn't mentioned. Could you look into that please?

Nope its a comma not a ; and yes I have now linked for 7th edit as well . Also these variable changes exist in many other files as well so it would be good if you would like to do it for other files as well.

@Starkyv
Copy link

Starkyv commented Sep 16, 2019

Can I take up this issue?

@jywarren
Copy link
Member

jywarren commented Sep 25, 2019 via email

@rahulzura
Copy link

Can I take this issue or is anyone working on it?

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Oct 12, 2019 via email

@harshkhandeparkar
Copy link
Member

I think this was fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants