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

deps: Update to eslint-config-transloadit@v2 #291

Merged
merged 14 commits into from Oct 29, 2021

Conversation

mifi
Copy link
Collaborator

@mifi mifi commented Oct 28, 2021

See transloadit/eslint-config-transloadit#13

biggest changes due to I pulled out Source classes into separate files.
I also simplified eslintrc (much of it is inherited from eslint-config-transloadit)

@Acconut
Copy link
Member

Acconut commented Oct 28, 2021

Thanks for the PR, but the linting process now generates some errors and tons of warning. The errors must be looked into and the warnings make the entire linter a bit useless since you are just flooded with them.

Before we merge this PR, we need to look into the error and warning to see which code needs to be adapted and which rules we have to disable or adjust.

@mifi
Copy link
Collaborator Author

mifi commented Oct 28, 2021

Yup I just realized there’s something wrong which I didnt get when i ran it locally, gonna look into that. As for warnings, many of them (531) were already there prior to this PR, but now there are 887, most of which come from the no-underscore-dangle. I think i’ll just completely disable that rule as it seems to be used a lot here.
I agree that it’s a lot of noise, so we should ideally fix all the warning issues and then change the rule to error instead (remove the warn overrides in the project) but maybe that should be done in a different pr?

@kvz kvz mentioned this pull request Oct 28, 2021
@kvz kvz assigned mifi Oct 28, 2021
because these files are generated only after build has been run, causing github actions lint to fail
@mifi
Copy link
Collaborator Author

mifi commented Oct 28, 2021

Alright I think I "fixed" the errors. Because eslint cannot find imported dist files for the tests before build has been run, it will fail during github actions run. I disabled the rules in the test files.

As for the warnings, shall we just try to run an eslint --fix and see what it can fix, maybe in a separate PR?

because it's being used a lot
@Acconut Acconut changed the title Eslint config transloadit v2 deps: Update to eslint-config-transloadit@v2 Oct 29, 2021
@Acconut
Copy link
Member

Acconut commented Oct 29, 2021

Because eslint cannot find imported dist files for the tests before build has been run, it will fail during github actions run. I disabled the rules in the test files.

Ok, in that case it would make sense to first run he build test and then the lint step. Would that help us with re-enabling the rules again?

As for warnings, many of them (531) were already there prior to this PR, but now there are 887, most of which come from the no-underscore-dangle. I think i’ll just completely disable that rule as it seems to be used a lot here.

Wow, I wasn't aware that we have so many warnings. Thanks for taking care of no-underscore-dangle.

As for the warnings, shall we just try to run an eslint --fix and see what it can fix, maybe in a separate PR?

Yes, we can try that in a separate PR. We have to discuss how far we should go with eslint --fix. For example, the code in /demos/browser/ is supposed to run un-compiled in the browser. So for every modern feature used in there, we have to consider which browsers it is supported in (e.g. const/let vs var)

@mifi
Copy link
Collaborator Author

mifi commented Oct 29, 2021

Ok, in that case it would make sense to first run he build test and then the lint step. Would that help us with re-enabling the rules again?

good idea. I did that.

Yes, we can try that in a separate PR. We have to discuss how far we should go with eslint --fix. For example, the code in /demos/browser/ is supposed to run un-compiled in the browser. So for every modern feature used in there, we have to consider which browsers it is supported in (e.g. const/let vs var)

We can exclude demos from eslint maybe. May not be that important that they are linted?

Copy link
Member

@Acconut Acconut left a comment

Choose a reason for hiding this comment

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

Let's merge it now and figure out a solution to all of the warning in a separate PR :) Thanks for your work!

@Acconut Acconut merged commit 56739c4 into tus:master Oct 29, 2021
@mifi mifi mentioned this pull request Oct 29, 2021
mifi added a commit to mifi/tus-js-client that referenced this pull request Oct 29, 2021
See discussion in tus#291
- had to disable no-use-before-define many places where onSuccess uses the upload object, maybe in the future onsuccess could provide upload as an argument to onSuccess
- also a lot of functions moved (as eslint doesn't allow function hoisting)
- disabled eslint for demos/cordova and demos/browser
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

2 participants