Skip to content

Commit de3b5a7

Browse files
committed
chore: migrate to @nextcloud/eslint-config 9
Its ESLint 10 reads a flat config only, so .eslintrc.cjs becomes eslint.config.js, whose rules apply to the app sources, leaving the exemptions version 9 grants test files in place. The lint workflow watched .eslintrc.* and .eslintignore, neither of which exists any more, and webpack.js was the last place configuring ESLint the old way: nothing declares its dependencies, so it could not run at all. The import rules are gone from the shared config, so 'import/extensions' goes with them, as do the babel parser options and the appVersion global the sources do not use, which the shared config declares anyway. 'no-console' was built into the old config and is now spelled out. The sources follow what the new rules ask for: sorted imports, blank lines between multi line component options, and camel cased attributes and events in templates. Unused callback parameters are gone, and the dashboard component is called GithubDashboard, because a name of one word can collide with an HTML element. One rule asks for the ellipsis character in a translatable string and so pointed at the widget's 'Loading...' message, which the dashboard component can never show, because it draws its own placeholder while it loads: the branch is gone rather than retranslated. The shared config brings @nextcloud/no-deprecated-library-props, which holds the prop renames of the library, gates each on the installed version and reports them. It calls itself fixable, but none of its forty reports carries a fixer, so it only pointed at NcPopover's focus-trap: the rename to noFocusTrap, and inverting the value it carried, are by hand. The old spelling was not declared any more, so the popover built a focus trap around content that holds a name and nothing tabbable, and focus-trap threw every time the popover opened. The .native modifier of three mouse listeners is one the Vue 3 compiler drops while keeping the listener, so removing it changes nothing; that holds for these three, not for key events, where the modifier is compiled as a key name and swallows the handler. NcLoadingIcon was given the name of its spinner as 'title'. The prop is called name, and the component writes it into the aria-label of a span with role img, so the spinner of the author popover carried an empty accessible name while the translated string sat on a tooltip. The widget passed its label to the dashboard component as 'showMoreText'. The prop is called showMoreLabel, so the link under a full widget read 'More items …' instead of what the widget asked for. Two more strings the widget cannot show go with it: a data property of the old name that the template never read, and the emptyContentMessage the dashboard component only uses as the fallback of a slot this widget always fills. Folding a comment, the popover of a comment author, the name of its spinner and the link under a full widget had no tests, and now have them. eslint.config.js has no place in the released archive, and neither the .eslintrc.js the packaging lists named nor the webpack.js and webpack.config.js they excluded exist here. The lint scripts passed --ext, which ESLint 10 ignores. The change filters named .eslintrc.* and an .eslintignore this app never had, and name the config file now, which their '**.js' entry matches only by the extension this app happens to use. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 5416c02 commit de3b5a7

33 files changed

Lines changed: 1373 additions & 3325 deletions

‎.eslintrc.cjs‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎.github/workflows/lint-eslint.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ jobs:
3737
- 'package.json'
3838
- 'package-lock.json'
3939
- 'tsconfig.json'
40-
- '.eslintrc.*'
41-
- '.eslintignore'
40+
- 'eslint.config.*'
4241
- '**.js'
4342
- '**.ts'
4443
- '**.vue'

‎.github/workflows/node.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- 'package.json'
4141
- 'package-lock.json'
4242
- 'tsconfig.json'
43+
- 'eslint.config.js'
4344
- '**.js'
4445
- '**.ts'
4546
- '**.vue'

‎.nextcloudignore‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.vscode
99
.php-cs-fixer.*
1010
/.codecov.yml
11-
/.eslintrc.js
11+
/eslint.config.js
1212
/.gitattributes
1313
/.gitignore
1414
/.l10nignore
@@ -34,8 +34,6 @@
3434
/pyproject.toml
3535
/renovate.json
3636
/stylelint.config.js
37-
/webpack.config.js
38-
/webpack.js
3937
/vite.config.ts
4038
tests
4139
/playwright

‎eslint.config.js‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { recommendedJavascript } from '@nextcloud/eslint-config'
7+
8+
export default [
9+
...recommendedJavascript,
10+
{
11+
name: 'integration_github/rules',
12+
files: ['src/**/*.js', 'src/**/*.vue'],
13+
rules: {
14+
'jsdoc/require-jsdoc': 'off',
15+
'jsdoc/tag-lines': 'off',
16+
'no-console': ['error', { allow: ['error', 'warn', 'info', 'debug'] }],
17+
'vue/first-attribute-linebreak': 'off',
18+
},
19+
},
20+
]

‎makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ appstore: clean
8282
--exclude=node_modules \
8383
--exclude=/src \
8484
--exclude=translationfiles \
85-
--exclude=webpack.* \
8685
--exclude=stylelint.config.js \
87-
--exclude=.eslintrc.js \
86+
--exclude=eslint.config.js \
8887
--exclude=.github \
8988
--exclude=.gitlab-ci.yml \
9089
--exclude=crowdin.yml \

0 commit comments

Comments
 (0)