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

chore: Enable ESLint for apps and fix all errors #46082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jun 24, 2024

Summary

Nevertheless this causes a huge amount of new warnings. Previously the shell script for directories to lint was wrong it was generating all app names to lint, but was missing the apps/ prefix. Causing only core to be linted.

Checklist

@susnux susnux added 3. to review Waiting for reviews ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Jun 24, 2024
@susnux susnux added this to the Nextcloud 30 milestone Jun 24, 2024
@susnux susnux requested a review from ShGKme June 24, 2024 22:11
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

LGTM! There are npm build changes though.

@@ -54,7 +54,6 @@ import { showError } from '@nextcloud/dialogs'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { confirmPassword } from '@nextcloud/password-confirmation'
import '@nextcloud/password-confirmation/dist/style.css'
Copy link
Member

Choose a reason for hiding this comment

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

I think this line should stay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, reason for ESLint to remove this is a typo in the password-confirmation package...

OC: any;
OCA: any;
OCP: any;
OC: Nextcloud.v28.OC;
Copy link
Member

Choose a reason for hiding this comment

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

Should this be 30 on master?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not available yet. We do not even have types for v29, release still waits for approval:
nextcloud-libraries/nextcloud-typings#260

@@ -70,7 +70,6 @@ import moment from '@nextcloud/moment'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { confirmPassword } from '@nextcloud/password-confirmation'
import '@nextcloud/password-confirmation/dist/style.css'
Copy link
Member

Choose a reason for hiding this comment

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

is it added globally somewhere or still needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can consider doing so but currently no it is not

Copy link
Member

Choose a reason for hiding this comment

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

But it is then still needed?

@nickvergessen
Copy link
Member

Nice find 🙈

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Thanks!

Checked all the changes, looks good.
I expected much more changes 👀

The only thing I'm working about is removing the import. Having a file it is not easily possible to say if removing this line is safe. And strictly, each file with dialogs must have dialog styles.

import '@nextcloud/password-confirmation/dist/style.css'

apps/federatedfilesharing/src/external.js Outdated Show resolved Hide resolved
Comment on lines +16 to +17
"lint": "eslint $(for appdir in $(ls apps); do if ! $(git check-ignore -q $appdir); then printf \"apps/$appdir \"; fi; done) core --no-error-on-unmatched-pattern",
"lint:fix": "eslint $(for appdir in $(ls apps); do if ! $(git check-ignore -q $appdir); then printf \"apps/$appdir \"; fi; done) core --no-error-on-unmatched-pattern --fix",
Copy link
Contributor

Choose a reason for hiding this comment

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

It's been worrying me for a year 🙈

@susnux susnux force-pushed the chore/enable-eslint branch 2 times, most recently from 735b77e to 94fb548 Compare June 26, 2024 13:51
Nevertheless this causes a huge amount of new warnings.
Previously the shell script for directories to lint was wrong it was generating all app names to lint,
but was missing the `apps/` prefix. Causing only `core` to be linted.

Co-authored-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants