Skip to content

Conversation

@ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Aug 31, 2025

☑️ Resolves

  • Fix dramastic difference between main and stable8 branches, making backporting complicated
  • Fix issues with TS support and import eslint plugin
  • Manual backport of chore: migrate to ESLint v9 #7233
  • See by commit:
    • They mostly apply a single change described in the message
    • Almost every commit has green test/eslint/build

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

@ShGKme ShGKme self-assigned this Aug 31, 2025
@ShGKme ShGKme added the 2. developing Work in progress label Aug 31, 2025
@ShGKme ShGKme changed the title [WIP] [stable8] chore: migrate to ESLint 9 and @nextcloud/eslint-config 9 [stable8] chore: migrate to ESLint 9 and @nextcloud/eslint-config 9 Aug 31, 2025
@ShGKme ShGKme requested review from Antreesy and susnux August 31, 2025 16:31
@ShGKme ShGKme marked this pull request as ready for review August 31, 2025 16:31
@ShGKme ShGKme added 3. to review Waiting for reviews technical debt and removed 2. developing Work in progress labels Aug 31, 2025
@ShGKme
Copy link
Contributor Author

ShGKme commented Aug 31, 2025

image

@susnux
Copy link
Contributor

susnux commented Aug 31, 2025

Looks like a massive amount of commits 👀
Weird when looking through git history - maybe squash them into auto fixable and rest by logic.

@ShGKme
Copy link
Contributor Author

ShGKme commented Aug 31, 2025

Looks like a massive amount of commits 👀

To make it easier to review, with a clear understanding of what was the source of what change and why.

A massive amount of commits for a massive amount of changes.

Weird when looking through git history

Why is it a problem?

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

I can squash some similar auto-fix commits (that fix related things in the same place as I already did).

But I don't want to squash everything:

  • Very inconvenient for review — you have just a massive change (that isn't even properly loading in GitHub) of different changes mixed
  • Hard to see what rule was the source of what change. It is especially useful when the change is weird.
  • For manual change - also good to see what exactly the change is fixing

E.g., in the original PR the source of some changes is still unclear for me.

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

Rebased onto stable8, resolved conflicts in NcCheckboxContent, no actual changes.

@ShGKme ShGKme requested a review from DorraJaouad September 1, 2025 08:37
@Antreesy
Copy link
Contributor

Antreesy commented Sep 1, 2025

One review please

image image

Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

Looks good

const formatted = content.replaceAll(
/by @([^ ]+) in ((https:\/\/github.com\/)nextcloud-libraries\/nextcloud-vue\/pull\/(\d+))/g,
'[\#$4]($2) \([$1]($3$1)\)'
'[#$4]($2) ([$1]($3$1))',
Copy link
Contributor

Choose a reason for hiding this comment

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

Diverged here from main as it should include the escaping backslash:

Suggested change
'[#$4]($2) ([$1]($3$1))',
'[\\#$4]($2) \\([$1]($3$1)\\)',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand, why we need a slash here.
But I'll add it to have the same as on the main branch.

<script setup>
import NcPasswordField from '../../../src/components/NcPasswordField/NcPasswordField.vue'
/* eslint-disable vue/require-prop-comment */
Copy link
Contributor

Choose a reason for hiding this comment

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

can be removed see below

// Disable required property documentation for test components
{
name: '@nextcloud/vue/test-override',
files: ['tests/**/*.vue'],
Copy link
Contributor

Choose a reason for hiding this comment

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

For this branch it needs to be:

Suggested change
files: ['tests/**/*.vue'],
files: [
'cypress/**/*.vue',
'tests/**/*.vue',
],

Comment on lines +50 to +65
name: '@nextcloud/vue/tests-jest',
files: ['tests/**/*.{js,ts}', '**/*.spec.{js,ts}', '**/*.test.{js,ts}'],
languageOptions: {
globals: {
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly',
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also make explicit instead with import { ... } from '@jest/globals'
Which we already do in a bunch of test files for better compatibility with vitest (backports work better as in the diff only the import module name changed)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could also make explicit instead with import { ... } from '@jest/globals'

Yes, but I didn't want to overload already large PR. This is not about ESLint migration itself and can be done in a follow-up.

At this moment this is configuration problem in the first place.

Comment on lines 330 to 333
:class="[{
'action-button--active': isChecked,
focusable: isFocusable,
}]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:class="[{
'action-button--active': isChecked,
focusable: isFocusable,
}]"
:class="{
'action-button--active': isChecked,
focusable: isFocusable,
}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same in some other places, fixing all of them

@susnux
Copy link
Contributor

susnux commented Sep 1, 2025

Why is it a problem?

Its hard to see different changes, you have to scroll more than 60 commits in the history log to get to the next changes.

A massive amount of commits for a massive amount of changes.

Yes but very related changes: "Migrate to ESLint 9 and Nextcloud ESLint config v9" 😉
For review it might make sense (as this is cosmetic only - I for example only review on the full changes as I only need to check if behavior is changed and or doc strings make sense).


Nevertheless changes look good, some few comments.

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

Added fixups according to the comments, except for import from jest globals. Will do it in a follow up as an a bit unrelated and a large change.

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Looks good but the lock file is a bit large, how did you upgrade? Normally I got like 1/4 of the lockfile lines removed when doing the upgrade to ESLint v9 - even on Vue 2.

Comment on lines +1241 to +1242
logger.warn('[NcAppSidebar] It looks like you want to use NcAppSidebar with the built-in toggle button. '
+ 'This feature is only available when NcAppSidebar is used in NcContent.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this a useless concat?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think its done to make the line shorter^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can be replaced with

logger.warn('[NcAppSidebar] It looks like you want to use NcAppSidebar with the built-in toggle button. This feature is only available when NcAppSidebar is used in NcContent.')

But then it is a very long line.

So, I'd say - no. It allows making it multi-line in the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

If its just visually in the editor then you also could just configure your IDE to break lines after X characters, saving one string concat instruction.
But both is fine for me 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.

Anyway, it is not a "useless concat" from the new ESLint rule's perspective 👀

@susnux
Copy link
Contributor

susnux commented Sep 1, 2025

I think rebase and squash fixups (DCO) than this should be ready to 🏃

```
npm un eslint vue-eslint-parser @nextcloud/eslint-config
eslint-plugin-cypress
npm i -D eslint@9 @nextcloud/eslint-config@next
 ```

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

how did you upgrade?

I put the command in the commit description to make it clear and reproduceable :P

npm un eslint vue-eslint-parser @nextcloud/eslint-config eslint-plugin-cypress
npm i -D eslint@9 @nextcloud/eslint-config@next

I double-checked and I haven't found any problems in dependencies bump.

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

  • Rabased onto stable8
  • Squashed fixup! commits
  • Squashed some related and small commits decreasing the amount from 69 to 56. I hope this is a bit less scary now :)

No actual more changes.

@ShGKme ShGKme merged commit c6f04cd into stable8 Sep 1, 2025
19 checks passed
@ShGKme ShGKme deleted the chore/eslint-9 branch September 1, 2025 16:50
@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

Its hard to see different changes, you have to scroll more than 60 commits in the history log to get to the next changes.

For me the review simplicity, rebasing and backporting seems to be more important. (To be honest, I don't know in which case I rely on the scrolling length in git). Because it's about the time of other developers during review.

We also have tons of dependabot commits (one commit + one merge per dependency), many small l10n updates (sometimes several times per day).

@ShGKme
Copy link
Contributor Author

ShGKme commented Sep 1, 2025

Yes but very related changes: "Migrate to ESLint 9 and Nextcloud ESLint config v9" 😉

This is too large change to work with it as a single change.

The PR to the main was complicated to review for me (that also why I postponed the review). And I saw no chance to backport it commit by commit also because of the size of the changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants