-
Notifications
You must be signed in to change notification settings - Fork 95
[stable8] chore: migrate to ESLint 9 and @nextcloud/eslint-config 9 #7418
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
Conversation
|
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.
Why is it a problem? |
|
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:
E.g., in the original PR the source of some changes is still unclear for me. |
847f094 to
50450d5
Compare
|
Rebased onto |
Antreesy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
build/format-changelog.mjs
Outdated
| 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))', |
There was a problem hiding this comment.
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:
| '[#$4]($2) ([$1]($3$1))', | |
| '[\\#$4]($2) \\([$1]($3$1)\\)', |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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
eslint.config.mjs
Outdated
| // Disable required property documentation for test components | ||
| { | ||
| name: '@nextcloud/vue/test-override', | ||
| files: ['tests/**/*.vue'], |
There was a problem hiding this comment.
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:
| files: ['tests/**/*.vue'], | |
| files: [ | |
| 'cypress/**/*.vue', | |
| 'tests/**/*.vue', | |
| ], |
| 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', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
| :class="[{ | ||
| 'action-button--active': isChecked, | ||
| focusable: isFocusable, | ||
| }]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :class="[{ | |
| 'action-button--active': isChecked, | |
| focusable: isFocusable, | |
| }]" | |
| :class="{ | |
| 'action-button--active': isChecked, | |
| focusable: isFocusable, | |
| }" |
There was a problem hiding this comment.
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
Its hard to see different changes, you have to scroll more than 60 commits in the history log to get to the next changes.
Yes but very related changes: "Migrate to ESLint 9 and Nextcloud ESLint config v9" 😉 Nevertheless changes look good, some few comments. |
|
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. |
susnux
left a comment
There was a problem hiding this 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.
| 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.') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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^^
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 👀
|
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>
455398d to
46e17cb
Compare
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@nextI double-checked and I haven't found any problems in dependencies bump. |
No actual more 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). |
This is too large change to work with it as a single change. The PR to the |



☑️ Resolves
mainandstable8branches, making backporting complicatedimporteslint plugin🏁 Checklist
stable8for maintained Vue 2 version or not applicable