Skip to content

chore: migrate to @nextcloud/eslint-config 9 - #157

Open
oleksandr-nc wants to merge 1 commit into
mainfrom
chore/eslint-config-9
Open

oleksandr-nc wants to merge 1 commit into
mainfrom
chore/eslint-config-9

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

@nextcloud/eslint-config 9 brings ESLint 10, which reads a flat config only and ignores .eslintrc.*.

The config

.eslintrc.js becomes eslint.config.mjs, spreading recommendedJavascript because the components here are plain JavaScript. The overrides that still exist are kept, no-console is spelled out because the old config had it built in, and three things are dropped: import/extensions, since the shared config no longer ships eslint-plugin-import, the babel parser options, and the appVersion global the sources never use.

The webpack plugin

eslint-webpack-plugin 5.x accepts ESLint 9 at most, so it moves to 6, and configType becomes flat.

The sources

What the new rules ask for, which eslint --fix applied: imports sorted, blank lines between multi line component options, attributes and events camel cased in templates, and the unused response arguments of promise callbacks removed. Two warnings remain and do not fail the build, both older than this change: a deprecated OC.dialogs call and an undeclared click emit.

Its ESLint 10 reads a flat config only, so .eslintrc.js becomes eslint.config.mjs
and eslint-webpack-plugin, whose 5.x releases accept ESLint 9 at most, moves to 6
and is told that the config is flat.

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. '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, camel cased attributes and events in templates, and
no unused response arguments.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>

This branch has not been deployed

No deployments
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.

1 participant