@nextcloud/eslint-config 9.0.0-rc.0 → 9.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +133 -44
- package/README.md +139 -33
- package/dist/configs/codeStyle.d.ts +13 -0
- package/dist/configs/codeStyle.js +176 -0
- package/dist/configs/documentation.d.ts +12 -0
- package/dist/configs/documentation.js +117 -0
- package/dist/configs/filesystem.d.ts +9 -0
- package/dist/configs/filesystem.js +25 -0
- package/dist/configs/imports.d.ts +12 -0
- package/dist/configs/imports.js +111 -0
- package/dist/configs/javascript.d.ts +14 -0
- package/dist/configs/javascript.js +118 -0
- package/dist/configs/json.d.ts +9 -0
- package/dist/configs/json.js +45 -0
- package/dist/configs/node.d.ts +10 -0
- package/dist/configs/node.js +24 -0
- package/dist/configs/typescript.d.ts +12 -0
- package/dist/configs/typescript.js +60 -0
- package/dist/configs/vue.d.ts +12 -0
- package/dist/configs/vue.js +158 -0
- package/dist/configs/vue2.d.ts +12 -0
- package/dist/configs/vue2.js +30 -0
- package/dist/configs/vue3.d.ts +12 -0
- package/dist/configs/vue3.js +48 -0
- package/dist/globs.d.ts +20 -0
- package/dist/globs.js +41 -0
- package/dist/index.d.ts +31 -31
- package/dist/index.js +81 -0
- package/dist/plugins/import-extensions/index.d.ts +15 -0
- package/dist/plugins/import-extensions/index.js +13 -0
- package/dist/plugins/import-extensions/rules/ban-inline-type-imports.d.ts +7 -0
- package/dist/plugins/import-extensions/rules/ban-inline-type-imports.js +176 -0
- package/dist/plugins/import-extensions/rules/extensions.d.ts +11 -0
- package/dist/plugins/import-extensions/rules/extensions.js +143 -0
- package/dist/plugins/import-extensions/rules/index.d.ts +8 -0
- package/dist/plugins/import-extensions/rules/index.js +10 -0
- package/dist/plugins/nextcloud/index.d.ts +7 -0
- package/dist/plugins/nextcloud/index.js +9 -0
- package/dist/plugins/nextcloud/rules/index.d.ts +6 -0
- package/dist/plugins/nextcloud/rules/index.js +18 -0
- package/dist/plugins/nextcloud/rules/l10n-enforce-ellipsis.d.ts +7 -0
- package/dist/plugins/nextcloud/rules/l10n-enforce-ellipsis.js +44 -0
- package/dist/plugins/nextcloud/rules/l10n-non-breaking-space.d.ts +7 -0
- package/dist/plugins/nextcloud/rules/l10n-non-breaking-space.js +39 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-globals.d.ts +7 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-globals.js +209 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-library-exports.d.ts +7 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-library-exports.js +89 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-library-props.d.ts +41 -0
- package/dist/plugins/nextcloud/rules/no-deprecated-library-props.js +429 -0
- package/dist/plugins/nextcloud/rules/no-removed-globals.d.ts +7 -0
- package/dist/plugins/nextcloud/rules/no-removed-globals.js +203 -0
- package/dist/plugins/nextcloud/utils/app-version-parser.d.ts +41 -0
- package/dist/plugins/nextcloud/utils/app-version-parser.js +106 -0
- package/dist/plugins/nextcloud/utils/lib-version-parser.d.ts +18 -0
- package/dist/plugins/nextcloud/utils/lib-version-parser.js +49 -0
- package/dist/plugins/nextcloud/utils/vue-template-visitor.d.ts +26 -0
- package/dist/plugins/nextcloud/utils/vue-template-visitor.js +38 -0
- package/dist/plugins/packageJson.d.ts +10 -0
- package/dist/plugins/packageJson.js +66 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +19 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +6 -0
- package/package.json +35 -27
- package/dist/index.mjs +0 -1464
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,51 +4,140 @@
|
|
|
4
4
|
-->
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
7
|
-
## [v9.0.0](https://github.com/nextcloud-libraries/eslint-config/tree/v9.0.0) (
|
|
7
|
+
## [v9.0.0](https://github.com/nextcloud-libraries/eslint-config/tree/v9.0.0) (unreleased)
|
|
8
8
|
|
|
9
9
|
### Breaking
|
|
10
|
-
This package now is using ESLint
|
|
10
|
+
This package now is using ESLint v10 and requires ESLint flat configurations.
|
|
11
11
|
Please refer to the README on how to adjust your configuration for flat config.
|
|
12
12
|
|
|
13
|
+
#### Potential pitfalls
|
|
14
|
+
Some of the used eslint plugins still keep a ESLint v8 compatibility,
|
|
15
|
+
this can cause some issues if not all packages are updated to the ESLint v10 compatible version.
|
|
16
|
+
|
|
17
|
+
If you see a linter error like the one below make sure to update all nested dependencies,
|
|
18
|
+
either using the sledge hammer method (remove the lock file and run `npm i`) or by running `npm update`.
|
|
19
|
+
|
|
20
|
+
> TypeError: scopeManager.addGlobals is not a function
|
|
21
|
+
|
|
13
22
|
### Added
|
|
14
|
-
* feat:
|
|
15
|
-
*
|
|
23
|
+
* feat: migrate to ESLint v10 [\#1323](https://github.com/nextcloud-libraries/eslint-config/pull/1323) \([susnux](https://github.com/susnux)\)
|
|
24
|
+
* feat: new modular config for (and with) ESLint v9 support [#887](https://github.com/nextcloud-libraries/eslint-config/pull/887)
|
|
25
|
+
* feat: merge plugin repository [#899](https://github.com/nextcloud-libraries/eslint-config/pull/899)
|
|
26
|
+
* feat: enforce non-breaking spaces before ellipsis for translations [\#948](https://github.com/nextcloud-libraries/eslint-config/pull/948)
|
|
27
|
+
* feat: add special config for libraries [\#949](https://github.com/nextcloud-libraries/eslint-config/pull/949)
|
|
28
|
+
* feat: add import and export rules [\#981](https://github.com/nextcloud-libraries/eslint-config/pull/981)
|
|
29
|
+
* feat: introduce @nextcloud/vue eslint plugin [\#939](https://github.com/nextcloud-libraries/eslint-config/pull/939)
|
|
30
|
+
* feat(codeStyle): enforce top-level-function [#1033](https://github.com/nextcloud-libraries/eslint-config/pull/1033) ([ShGKme](https://github.com/ShGKme))
|
|
31
|
+
* feat(nextcloud-vue): add rule for deprecated NcButton props [#1045](https://github.com/nextcloud-libraries/eslint-config/pull/1045) ([susnux](https://github.com/susnux))
|
|
32
|
+
* feat(vue): add `vue/no-useless-v-bind` rule [#1063](https://github.com/nextcloud-libraries/eslint-config/pull/1063) ([susnux](https://github.com/susnux))
|
|
33
|
+
* feat(vue): add `vue/prefer-separate-static-class` rule [#1065](https://github.com/nextcloud-libraries/eslint-config/pull/1065) ([susnux](https://github.com/susnux))
|
|
34
|
+
* feat(vue3): add script-setup releated rules [#1064](https://github.com/nextcloud-libraries/eslint-config/pull/1064) ([susnux](https://github.com/susnux))
|
|
35
|
+
* feat(no-deprecated-props): extend existing rules to support other components [\#1069](https://github.com/nextcloud-libraries/eslint-config/pull/1069) \([Antreesy](https://github.com/Antreesy)\)
|
|
36
|
+
* feat(imports): add custom plugin to suggest file extensions [\#1110](https://github.com/nextcloud-libraries/eslint-config/pull/1110) \([susnux](https://github.com/susnux)\)
|
|
37
|
+
* feat(filesystem): ignore all files within the `.gitignore` [\#1108](https://github.com/nextcloud-libraries/eslint-config/pull/1108) \([susnux](https://github.com/susnux)\)
|
|
38
|
+
* feat(l10n-plugin): also handle vue templates [\#1113](https://github.com/nextcloud-libraries/eslint-config/pull/1113) \([susnux](https://github.com/susnux)\)
|
|
39
|
+
* feat(nextcloud-vue-plugin): deprecate additional props [\#1163](https://github.com/nextcloud-libraries/eslint-config/pull/1163) \([Antreesy](https://github.com/Antreesy)\)
|
|
40
|
+
* feat(nextcloud-vue-plugin): deprecate additional exports [\#1162](https://github.com/nextcloud-libraries/eslint-config/pull/1162) \([Antreesy](https://github.com/Antreesy)\)
|
|
41
|
+
* feat(nextcloud-vue-plugin): deprecate NcPopover props [\#1165](https://github.com/nextcloud-libraries/eslint-config/pull/1165) \([Antreesy](https://github.com/Antreesy)\)
|
|
42
|
+
* feat(vue): add vue/component-options-name-casing with PascalCase [\#1261](https://github.com/nextcloud-libraries/eslint-config/pull/1261) \([ShGKme](https://github.com/ShGKme)\)
|
|
43
|
+
* feat(vue3): force camelCase for events in `<script>` [\#1262](https://github.com/nextcloud-libraries/eslint-config/pull/1262) \([ShGKme](https://github.com/ShGKme)\)
|
|
44
|
+
* feat(vue3): force camelCase for events in `<template>` [\#1263](https://github.com/nextcloud-libraries/eslint-config/pull/1263) \([ShGKme](https://github.com/ShGKme)\)
|
|
45
|
+
* feat(vue3): force camelCase for slot names [\#1264](https://github.com/nextcloud-libraries/eslint-config/pull/1264) \([ShGKme](https://github.com/ShGKme)\)
|
|
46
|
+
* feat(vue3): force camelCase for props in template [\#1266](https://github.com/nextcloud-libraries/eslint-config/pull/1266) \([ShGKme](https://github.com/ShGKme)\)
|
|
47
|
+
* feat(import): enforce consistent types imports and ban usage of inline type specifiers [\#1382](https://github.com/nextcloud-libraries/eslint-config/pull/1382) \([susnux](https://github.com/susnux)\)
|
|
16
48
|
|
|
17
49
|
### Fixed
|
|
50
|
+
* fix(codestyle): do not require splitting chains [\#951](https://github.com/nextcloud-libraries/eslint-config/pull/951)
|
|
51
|
+
* fix(codestyle): adjust empty lines style [\#952](https://github.com/nextcloud-libraries/eslint-config/pull/952)
|
|
18
52
|
* fix(codestyle): Enforce no space before function parenthesis [#901](https://github.com/nextcloud-libraries/eslint-config/pull/901)
|
|
19
53
|
* fix(codeStyle): Adjust `stylistic` rules config [#914](https://github.com/nextcloud-libraries/eslint-config/pull/914)
|
|
54
|
+
* fix(codeStyle): allow single line arrays [\#997](https://github.com/nextcloud-libraries/eslint-config/pull/997)
|
|
55
|
+
* fix(codeStyle): allow devs write small objects in one line [\#996](https://github.com/nextcloud-libraries/eslint-config/pull/996)
|
|
56
|
+
* fix(globs): properly ignore test files [\#974](https://github.com/nextcloud-libraries/eslint-config/pull/974)
|
|
57
|
+
* fix(imports): do not mix externals and internals [\#1000](https://github.com/nextcloud-libraries/eslint-config/pull/1000)
|
|
58
|
+
* fix(javascript): allow using functions before they are defined [\#970](https://github.com/nextcloud-libraries/eslint-config/pull/970)
|
|
59
|
+
* fix(javascript): add missing `appName` and `appVersion` global + fix access [\#972](https://github.com/nextcloud-libraries/eslint-config/pull/972)
|
|
60
|
+
* fix(typescript): allow to use function before definition [\#950](https://github.com/nextcloud-libraries/eslint-config/pull/950)
|
|
61
|
+
* fix(typescript): remove `@typescript-eslint/no-shadow` [\#993](https://github.com/nextcloud-libraries/eslint-config/pull/993)
|
|
62
|
+
* fix(typescript): enforce `import type` for type only imports [\#977](https://github.com/nextcloud-libraries/eslint-config/pull/977)
|
|
63
|
+
* fix(vue): allow JS Vue files [#998](https://github.com/nextcloud-libraries/eslint-config/pull/998) ([ShGKme](https://github.com/ShGKme))
|
|
64
|
+
* fix(documentation): do not remove JSDoc types in Vue JS files [#995](https://github.com/nextcloud-libraries/eslint-config/pull/995) ([ShGKme](https://github.com/ShGKme))
|
|
65
|
+
* fix(typescript): allow import in type annotation [#1034](https://github.com/nextcloud-libraries/eslint-config/pull/1034) ([ShGKme](https://github.com/ShGKme))
|
|
66
|
+
* fix(documentation): do not lint tests for documentation issues [#1062](https://github.com/nextcloud-libraries/eslint-config/pull/1062) ([susnux](https://github.com/susnux))
|
|
67
|
+
* fix: ignore `l10n` and `js` directory for apps [#1061](https://github.com/nextcloud-libraries/eslint-config/pull/1061) ([susnux](https://github.com/susnux))
|
|
68
|
+
* fix(imports): do not mix externals and internals [#1000](https://github.com/nextcloud-libraries/eslint-config/pull/1000) ([ShGKme](https://github.com/ShGKme))
|
|
69
|
+
* fix(codeStyle): allow single line arrays [#997](https://github.com/nextcloud-libraries/eslint-config/pull/997) ([ShGKme](https://github.com/ShGKme))
|
|
70
|
+
* fix(typescript): remove `@typescript-eslint/no-shadow` [#993](https://github.com/nextcloud-libraries/eslint-config/pull/993) ([ShGKme](https://github.com/ShGKme))
|
|
71
|
+
* fix(codeStyle): allow devs write small objects in one line [#996](https://github.com/nextcloud-libraries/eslint-config/pull/996) ([ShGKme](https://github.com/ShGKme))
|
|
72
|
+
* fix: ignore test report directories from linting [\#1096](https://github.com/nextcloud-libraries/eslint-config/pull/1096) \([Antreesy](https://github.com/Antreesy)\)
|
|
73
|
+
* fix(vue): also ignore the global router link component [\#1097](https://github.com/nextcloud-libraries/eslint-config/pull/1097) \([susnux](https://github.com/susnux)\)
|
|
74
|
+
* fix(no-deprecated-props): respect nextcloud/vue library version for the rule [\#1084](https://github.com/nextcloud-libraries/eslint-config/pull/1084) \([Antreesy](https://github.com/Antreesy)\)
|
|
75
|
+
* fix(codestyle): replace deprecated config in `@stylistic/quotes` rule [\#1109](https://github.com/nextcloud-libraries/eslint-config/pull/1109) \([susnux](https://github.com/susnux)\)
|
|
76
|
+
* fix(l10n-plugin): also check translation strings in `n` method [\#1112](https://github.com/nextcloud-libraries/eslint-config/pull/1112) \([susnux](https://github.com/susnux)\)
|
|
77
|
+
* fix(filesystem): relax ignored files [\#1114](https://github.com/nextcloud-libraries/eslint-config/pull/1114) \([susnux](https://github.com/susnux)\)
|
|
78
|
+
* fix(globs): adjust globs for test related files [\#1128](https://github.com/nextcloud-libraries/eslint-config/pull/1128) \([susnux](https://github.com/susnux)\)
|
|
79
|
+
* fix(vue): use vue variant of `no-irregular-whitespace` [\#1129](https://github.com/nextcloud-libraries/eslint-config/pull/1129) \([susnux](https://github.com/susnux)\)
|
|
80
|
+
* fix(nextcloud): add missing deprecations and removals [\#1206](https://github.com/nextcloud-libraries/eslint-config/pull/1206) \([susnux](https://github.com/susnux)\)
|
|
81
|
+
* fix(plugin:nextcloud-vue): use resolved dependency for detecting nextcloud-vue version [\#1220](https://github.com/nextcloud-libraries/eslint-config/pull/1220) \([susnux](https://github.com/susnux)\)
|
|
82
|
+
* fix: switch to `@stylistic/exp-list-style` to resolve array edge-cases [\#1203](https://github.com/nextcloud-libraries/eslint-config/pull/1203) \([susnux](https://github.com/susnux)\)
|
|
83
|
+
* fix(nextcloud-plugin): add more removed API in Nextcloud 33 [\#1269](https://github.com/nextcloud-libraries/eslint-config/pull/1269) \([susnux](https://github.com/susnux)\)
|
|
84
|
+
* fix: use vue-eslint-parser directly [\#1277](https://github.com/nextcloud-libraries/eslint-config/pull/1277) \([susnux](https://github.com/susnux)\)
|
|
85
|
+
* fix(imports): no newline inside import statements [\#1379](https://github.com/nextcloud-libraries/eslint-config/pull/1379) \([max-nextcloud](https://github.com/max-nextcloud)\)
|
|
20
86
|
|
|
21
87
|
### Changed
|
|
22
88
|
* Add SPDX header [#802](https://github.com/nextcloud-libraries/eslint-config/pull/802)
|
|
23
89
|
* Updated development dependencies
|
|
24
90
|
* refactor(json): drop now unneeded `@ts-expect-error` [#915](https://github.com/nextcloud-libraries/eslint-config/pull/915)
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
91
|
+
* refactor: use camelCase for internal variables [#971](https://github.com/nextcloud-libraries/eslint-config/pull/971) ([susnux](https://github.com/susnux))
|
|
92
|
+
* chore: do not bundle config but just use Typescript [#967](https://github.com/nextcloud-libraries/eslint-config/pull/967)
|
|
93
|
+
* chore: require node ^20.19 [\#982](https://github.com/nextcloud-libraries/eslint-config/pull/982)
|
|
94
|
+
* chore: remove EOL Node version and add new future LTS [\#1381](https://github.com/nextcloud-libraries/eslint-config/pull/1381) \([susnux](https://github.com/susnux)\)
|
|
95
|
+
* chore: allow to run `npm lint` without compile step [#975](https://github.com/nextcloud-libraries/eslint-config/pull/975) ([susnux](https://github.com/susnux))
|
|
96
|
+
* chore: prepare v9.0.0-rc.1 [#1010](https://github.com/nextcloud-libraries/eslint-config/pull/1010) ([susnux](https://github.com/susnux))
|
|
97
|
+
* docs: consistent badge style with the reuse one [#1060](https://github.com/nextcloud-libraries/eslint-config/pull/1060) ([susnux](https://github.com/susnux))
|
|
98
|
+
* docs: add documentation about update policy and development [#1009](https://github.com/nextcloud-libraries/eslint-config/pull/1009) ([susnux](https://github.com/susnux))
|
|
99
|
+
* test: fix tests and add workflow to run them on CI [#1046](https://github.com/nextcloud-libraries/eslint-config/pull/1046) ([susnux](https://github.com/susnux))
|
|
100
|
+
* ci: update workflows from organization [#1047](https://github.com/nextcloud-libraries/eslint-config/pull/1047) ([susnux](https://github.com/susnux))
|
|
101
|
+
* chore: add active node version (24) to supported engines [#1066](https://github.com/nextcloud-libraries/eslint-config/pull/1066) ([susnux](https://github.com/susnux))
|
|
102
|
+
* build: add common changelog formatting and documentation for it [#1067](https://github.com/nextcloud-libraries/eslint-config/pull/1067) ([susnux](https://github.com/susnux))
|
|
103
|
+
* chore: lint this project as a library [\#1130](https://github.com/nextcloud-libraries/eslint-config/pull/1130) \([susnux](https://github.com/susnux)\)
|
|
104
|
+
* chore: update devEngines to align with apps [\#1204](https://github.com/nextcloud-libraries/eslint-config/pull/1204) \([susnux](https://github.com/susnux)\)
|
|
105
|
+
* build: disable libcheck for Typescript [\#1205](https://github.com/nextcloud-libraries/eslint-config/pull/1205) \([susnux](https://github.com/susnux)\)
|
|
106
|
+
* chore(gitignore): ignore IDE configs [\#1265](https://github.com/nextcloud-libraries/eslint-config/pull/1265) \([ShGKme](https://github.com/ShGKme)\)
|
|
107
|
+
* test(vue3): add some formatting tests [\#1267](https://github.com/nextcloud-libraries/eslint-config/pull/1267) \([ShGKme](https://github.com/ShGKme)\)
|
|
108
|
+
* refactor: merge Nextcloud specific rules into the `@nextcloud` plugin [\#1278](https://github.com/nextcloud-libraries/eslint-config/pull/1278) \([susnux](https://github.com/susnux)\)
|
|
109
|
+
* Updated `@eslint/json` to 2.0.0
|
|
110
|
+
* Updated `@stylistic/eslint-plugin` to 5.7.0
|
|
111
|
+
* Updated `eslint-config-flat-gitignore` to 2.1.0
|
|
112
|
+
* Updated `eslint-plugin-antfu` to 3.2.3
|
|
113
|
+
* Updated `eslint-plugin-jsdoc` to 63.0.4
|
|
114
|
+
* Updated `eslint-plugin-perfectionist` to 5.9.1
|
|
115
|
+
* Updated `eslint-plugin-vue` to 10.9.2
|
|
116
|
+
* Updated `fast-xml-parser` to 5.9.0
|
|
117
|
+
* Updated `globals` to 17.6.0
|
|
118
|
+
* Updated `semver` to 7.8.4
|
|
119
|
+
* Updated `sort-package-json` to 4.0.0
|
|
120
|
+
* Updated `typescript-eslint` to 8.61.1
|
|
32
121
|
|
|
33
122
|
## [v8.4.2](https://github.com/nextcloud-libraries/eslint-config/tree/v8.4.2) (2025-02-16)
|
|
34
123
|
### Fixed
|
|
35
|
-
* fix(typescript): do not require returns type in jsdoc
|
|
124
|
+
* fix(typescript): do not require returns type in jsdoc [#857](https://github.com/nextcloud-libraries/eslint-config/pull/857) ([ShGKme](https://github.com/ShGKme))
|
|
36
125
|
|
|
37
126
|
### Changed
|
|
38
127
|
* Updated development dependencies
|
|
39
|
-
* Add SPDX header
|
|
40
|
-
* enh(git): ignore formatting commits in git blame
|
|
128
|
+
* Add SPDX header [#802](https://github.com/nextcloud-libraries/eslint-config/pull/802) ([AndyScherzinger](https://github.com/AndyScherzinger))
|
|
129
|
+
* enh(git): ignore formatting commits in git blame [#854](https://github.com/nextcloud-libraries/eslint-config/pull/854) ([max-nextcloud](https://github.com/max-nextcloud))
|
|
41
130
|
|
|
42
131
|
## [v8.4.1](https://github.com/nextcloud-libraries/eslint-config/tree/v8.4.1) (2024-05-16)
|
|
43
132
|
|
|
44
133
|
[Full Changelog](https://github.com/nextcloud-libraries/eslint-config/compare/v8.4.0...v8.4.1)
|
|
45
134
|
|
|
46
135
|
### Fixes
|
|
47
|
-
* fix(vue3): align rules with Vue 2 rules
|
|
48
|
-
* fix(vue3): config crashes ESLint
|
|
136
|
+
* fix(vue3): align rules with Vue 2 rules [#771](https://github.com/nextcloud-libraries/eslint-config/pull/771) ([ShGKme](https://github.com/ShGKme))
|
|
137
|
+
* fix(vue3): config crashes ESLint [#770](https://github.com/nextcloud-libraries/eslint-config/pull/770) ([ShGKme](https://github.com/ShGKme))
|
|
49
138
|
|
|
50
139
|
### Changed
|
|
51
|
-
* build(deps-dev): Bump eslint-plugin-jsdoc from 48.2.4 to 48.2.5
|
|
140
|
+
* build(deps-dev): Bump eslint-plugin-jsdoc from 48.2.4 to 48.2.5 [#769](https://github.com/nextcloud-libraries/eslint-config/pull/769) ([dependabot](https://github.com/dependabot))
|
|
52
141
|
|
|
53
142
|
## [v8.4.0](https://github.com/nextcloud-libraries/eslint-config/tree/v8.4.0) (2024-05-15)
|
|
54
143
|
### Features
|
|
@@ -59,36 +148,36 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
59
148
|
|
|
60
149
|
### Features
|
|
61
150
|
* Typescript 5 support
|
|
62
|
-
* Allow linting of typescript with module resolution set to `node16` or `nodenext`
|
|
63
|
-
* Support Composition API & Typescript + Vue projects
|
|
64
|
-
* Allow linting of TSX files
|
|
151
|
+
* Allow linting of typescript with module resolution set to `node16` or `nodenext` [#527](https://github.com/nextcloud-libraries/eslint-config/pull/527) ([susnux](https://github.com/susnux))
|
|
152
|
+
* Support Composition API & Typescript + Vue projects [#562](https://github.com/nextcloud-libraries/eslint-config/pull/562) ([susnux](https://github.com/susnux))
|
|
153
|
+
* Allow linting of TSX files [#456](https://github.com/nextcloud-libraries/eslint-config/pull/456) ([susnux](https://github.com/susnux))
|
|
65
154
|
|
|
66
155
|
### Fixes
|
|
67
|
-
* Ignore camelcase rule for __webpack variables
|
|
68
|
-
* Add Typescript overrides for all valid Typescript file extensions
|
|
69
|
-
* Allow empty functions
|
|
70
|
-
* fix(typescript): Also set the typescript settings to the vue overrides for typescript import resolving
|
|
71
|
-
* fix(typescript): Allow generic type parameters on function calls
|
|
72
|
-
* Make sure vue files written in Typescript are linted correctly
|
|
73
|
-
* fix: Allow to import packages from `devDependencies` within config files
|
|
74
|
-
* fix: Allow `@jest-environment` docblock for jest tests
|
|
156
|
+
* Ignore camelcase rule for __webpack variables [#530](https://github.com/nextcloud-libraries/eslint-config/pull/530) ([kesselb](https://github.com/kesselb))
|
|
157
|
+
* Add Typescript overrides for all valid Typescript file extensions [#567](https://github.com/nextcloud-libraries/eslint-config/pull/567) ([susnux](https://github.com/susnux))
|
|
158
|
+
* Allow empty functions [#570](https://github.com/nextcloud-libraries/eslint-config/pull/570) ([skjnldsv](https://github.com/skjnldsv))
|
|
159
|
+
* fix(typescript): Also set the typescript settings to the vue overrides for typescript import resolving [#639](https://github.com/nextcloud-libraries/eslint-config/pull/639) ([susnux](https://github.com/susnux))
|
|
160
|
+
* fix(typescript): Allow generic type parameters on function calls [#571](https://github.com/nextcloud-libraries/eslint-config/pull/571) ([susnux](https://github.com/susnux))
|
|
161
|
+
* Make sure vue files written in Typescript are linted correctly [#579](https://github.com/nextcloud-libraries/eslint-config/pull/579) ([susnux](https://github.com/susnux))
|
|
162
|
+
* fix: Allow to import packages from `devDependencies` within config files [#580](https://github.com/nextcloud-libraries/eslint-config/pull/580) ([susnux](https://github.com/susnux))
|
|
163
|
+
* fix: Allow `@jest-environment` docblock for jest tests [#592](https://github.com/nextcloud-libraries/eslint-config/pull/592) ([susnux](https://github.com/susnux))
|
|
75
164
|
|
|
76
165
|
### Changed
|
|
77
166
|
* Various dependencies upgrades
|
|
78
|
-
* chore: Update `@nextcloud/eslint-plugin` to version 2.1.0
|
|
79
|
-
* Drop webpack dependency
|
|
167
|
+
* chore: Update `@nextcloud/eslint-plugin` to version 2.1.0 [#605](https://github.com/nextcloud-libraries/eslint-config/pull/605) ([susnux](https://github.com/susnux))
|
|
168
|
+
* Drop webpack dependency [#528](https://github.com/nextcloud-libraries/eslint-config/pull/528) ([susnux](https://github.com/susnux))
|
|
80
169
|
538
|
|
81
|
-
* Update node engines to next LTS (node 20 and NPM 9)
|
|
170
|
+
* Update node engines to next LTS (node 20 and NPM 9) [#563](https://github.com/nextcloud-libraries/eslint-config/pull/563) ([nextcloud-command](https://github.com/nextcloud-command))
|
|
82
171
|
565
|
|
83
|
-
* Make eslint to take this config for linting the config
|
|
84
|
-
* chore: Fix URLs after package got transfered
|
|
172
|
+
* Make eslint to take this config for linting the config [#572](https://github.com/nextcloud-libraries/eslint-config/pull/572) ([susnux](https://github.com/susnux))
|
|
173
|
+
* chore: Fix URLs after package got transfered [#602](https://github.com/nextcloud-libraries/eslint-config/pull/602) ([susnux](https://github.com/susnux))
|
|
85
174
|
|
|
86
175
|
## [v8.2.1](https://github.com/nextcloud-libraries/eslint-config/tree/v8.2.1) (2023-01-30)
|
|
87
176
|
|
|
88
177
|
[Full Changelog](https://github.com/nextcloud-libraries/eslint-config/compare/v8.2.0...v8.2.1)
|
|
89
178
|
|
|
90
179
|
**Fixed:**
|
|
91
|
-
- Fix resolving packages that use the package `exports` feature
|
|
180
|
+
- Fix resolving packages that use the package `exports` feature [#452](https://github.com/nextcloud-libraries/eslint-config/pull/452) ([susnux](https://github.com/susnux))
|
|
92
181
|
|
|
93
182
|
**Merged pull requests:**
|
|
94
183
|
- Various dependencies upgrades
|
|
@@ -110,8 +199,8 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
110
199
|
[Full Changelog](https://github.com/nextcloud-libraries/eslint-config/compare/v8.1.4...v8.1.5)
|
|
111
200
|
|
|
112
201
|
**Dependency updates:**
|
|
113
|
-
- Bump json5 from 1.0.1 to 1.0.2
|
|
114
|
-
- Bump json5 from 2.2.1 to 2.2.3
|
|
202
|
+
- Bump json5 from 1.0.1 to 1.0.2 [#430](https://github.com/nextcloud-libraries/eslint-config/pull/430) ([PVince81](https://github.com/PVince81))
|
|
203
|
+
- Bump json5 from 2.2.1 to 2.2.3 [#430](https://github.com/nextcloud-libraries/eslint-config/pull/430) ([PVince81](https://github.com/PVince81))
|
|
115
204
|
|
|
116
205
|
## [v8.1.4](https://github.com/nextcloud-libraries/eslint-config/tree/v8.1.4) (2022-11-17)
|
|
117
206
|
|
|
@@ -125,16 +214,16 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
125
214
|
[Full Changelog](https://github.com/nextcloud-libraries/eslint-config/compare/v8.1.2...v8.1.3)
|
|
126
215
|
|
|
127
216
|
**Fixed:**
|
|
128
|
-
- Allow TypeScript syntax in JSDoc comments
|
|
217
|
+
- Allow TypeScript syntax in JSDoc comments [#413](https://github.com/nextcloud-libraries/eslint-config/pull/413) ([Pytal](https://github.com/Pytal))
|
|
129
218
|
|
|
130
219
|
**Dependency updates:**
|
|
131
|
-
- Bump @babel/core from 7.18.10 to 7.19.6
|
|
132
|
-
- Bump @babel/eslint-parser from 7.18.9 to 7.19.1
|
|
133
|
-
- Bump eslint from 8.21.0 to 8.26.0
|
|
134
|
-
- Bump eslint-plugin-jsdoc from 39.3.13 to 39.6.2
|
|
135
|
-
- Bump eslint-plugin-n from 15.2.4 to 15.4.0
|
|
136
|
-
- Bump eslint-plugin-promise from 6.0.0 to 6.1.1
|
|
137
|
-
- Bump eslint-plugin-vue from 9.3.0 to 9.7.0
|
|
220
|
+
- Bump @babel/core from 7.18.10 to 7.19.6 [#404](https://github.com/nextcloud-libraries/eslint-config/pull/404) ([dependabot](https://github.com/dependabot))
|
|
221
|
+
- Bump @babel/eslint-parser from 7.18.9 to 7.19.1 [#392](https://github.com/nextcloud-libraries/eslint-config/pull/392) ([dependabot](https://github.com/dependabot))
|
|
222
|
+
- Bump eslint from 8.21.0 to 8.26.0 [#406](https://github.com/nextcloud-libraries/eslint-config/pull/406) ([dependabot](https://github.com/dependabot))
|
|
223
|
+
- Bump eslint-plugin-jsdoc from 39.3.13 to 39.6.2 [#414](https://github.com/nextcloud-libraries/eslint-config/pull/414) ([dependabot](https://github.com/dependabot))
|
|
224
|
+
- Bump eslint-plugin-n from 15.2.4 to 15.4.0 [#409](https://github.com/nextcloud-libraries/eslint-config/pull/409) ([dependabot](https://github.com/dependabot))
|
|
225
|
+
- Bump eslint-plugin-promise from 6.0.0 to 6.1.1 [#405](https://github.com/nextcloud-libraries/eslint-config/pull/405) ([dependabot](https://github.com/dependabot))
|
|
226
|
+
- Bump eslint-plugin-vue from 9.3.0 to 9.7.0 [#410](https://github.com/nextcloud-libraries/eslint-config/pull/410) ([dependabot](https://github.com/dependabot))
|
|
138
227
|
|
|
139
228
|
## [v8.1.2](https://github.com/nextcloud-libraries/eslint-config/tree/v8.1.2) (2022-08-09)
|
|
140
229
|
|
package/README.md
CHANGED
|
@@ -5,25 +5,30 @@
|
|
|
5
5
|
## @nextcloud/eslint-config
|
|
6
6
|
|
|
7
7
|
[](https://api.reuse.software/info/github.com/nextcloud-libraries/eslint-config)
|
|
8
|
-
[](https://www.npmjs.com/package/@nextcloud/eslint-config)
|
|
9
|
+
[](https://github.com/nextcloud-libraries/eslint-config/actions/workflows/lint.yml)
|
|
10
|
+
[](https://dependabot.com)
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
This is a package containing the unified global eslint config used by all nextcloud apps and libraries.
|
|
14
14
|
It contains the necessary dependencies and peerDependencies so that other apps cannot update if this config does not support it.
|
|
15
15
|
Please always use dependabot to update your apps, OR pay attention to the peer dependencies error messages!
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The rules within this configuration are based on, and enforce, the Nextcloud [coding style](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/coding_standards/javascript.html#code-style). Additionally, we follow the common code styles and best practices used in the Vue ecosystem as we strongly focussed on Vue based UI code.
|
|
18
|
+
|
|
19
|
+
> [!TIP]
|
|
20
|
+
> For backend code there is also a similar configuration for PHP code available enforcing our PHP codestyle, see [Nextcloud cs-fixer](https://github.com/nextcloud/coding-standard/).
|
|
21
|
+
|
|
22
|
+
### Installation
|
|
18
23
|
|
|
19
24
|
```bash
|
|
20
|
-
npm install @nextcloud/eslint-config
|
|
25
|
+
npm install --save-dev @nextcloud/eslint-config
|
|
21
26
|
```
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
### Usage
|
|
24
29
|
|
|
25
|
-
> [!NOTE]
|
|
26
|
-
> Since version 9 this package depends on ESLint
|
|
30
|
+
> [!NOTE]
|
|
31
|
+
> Since version 9 this package depends on ESLint 10, which uses the new flat config system.
|
|
27
32
|
|
|
28
33
|
This package provides some predefined configurations you can choose from.
|
|
29
34
|
For the recommended setup add a file `eslint.config.js` in the root directory of your app repository with the following content:
|
|
@@ -36,7 +41,7 @@ export default [
|
|
|
36
41
|
]
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
#### Available configurations
|
|
40
45
|
|
|
41
46
|
Instead of the `recommended` configuration this package also provides some alternatives, depending on your app setup you can also choose:
|
|
42
47
|
|
|
@@ -52,7 +57,16 @@ Instead of the `recommended` configuration this package also provides some alter
|
|
|
52
57
|
* `recommendedVue2Javascript`
|
|
53
58
|
* Same as `recommended` but Vue files are considered in Vue 2 syntax and the script part will be handled as Javascript instead of Typescript.
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
##### Configurations for Nextcloud libraries
|
|
61
|
+
|
|
62
|
+
For libraries some of the presets make no sense, like checking Nextcloud deprecated API.
|
|
63
|
+
But on the otherhand some rules should be enforced, like documenting all properties.
|
|
64
|
+
So for libraries use following configurations:
|
|
65
|
+
|
|
66
|
+
* `recommendedLibrary`
|
|
67
|
+
* `recommendedVue2Library`
|
|
68
|
+
|
|
69
|
+
#### Bundled plugins
|
|
56
70
|
|
|
57
71
|
This configuration also provides some bundled plugins with new rules, those options are already included in the recommended configurations.
|
|
58
72
|
|
|
@@ -61,14 +75,14 @@ It is possible to override the recommended configurations:
|
|
|
61
75
|
// eslint.config.js
|
|
62
76
|
import { recommended } from '@nextcloud/eslint-config'
|
|
63
77
|
export default [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
...recommended,
|
|
79
|
+
{
|
|
80
|
+
files: ['**/*.js'],
|
|
81
|
+
rules: {
|
|
82
|
+
// Make deprecations error instead of warning level
|
|
83
|
+
'@nextcloud/no-deprecated-globals': ['error'],
|
|
84
|
+
}
|
|
85
|
+
}
|
|
72
86
|
]
|
|
73
87
|
```
|
|
74
88
|
|
|
@@ -77,27 +91,27 @@ You can even use the plugins without using the Nextcloud ESLint config:
|
|
|
77
91
|
// eslint.config.js
|
|
78
92
|
import { nextcloudPlugin } from '@nextcloud/eslint-config'
|
|
79
93
|
export default [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
{
|
|
95
|
+
files: ['**/*.js'],
|
|
96
|
+
plugins: {
|
|
83
97
|
'@nextcloud': nextcloudPlugin,
|
|
84
98
|
},
|
|
85
99
|
rules: {
|
|
86
|
-
'@nextcloud/no-removed-
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
'@nextcloud/no-removed-globals': ['error', { targetVersion: '29.0.0' }],
|
|
101
|
+
},
|
|
102
|
+
}
|
|
89
103
|
]
|
|
90
104
|
```
|
|
91
105
|
|
|
92
|
-
|
|
106
|
+
##### `package-json` plugin
|
|
93
107
|
Rules:
|
|
94
108
|
- `sort-package-json`
|
|
95
109
|
- Ensures the `package.json` is sorted in consistent order
|
|
96
110
|
- Included as `error` level in recommended configurations
|
|
97
111
|
|
|
98
|
-
|
|
112
|
+
##### `@nextcloud` plugin
|
|
99
113
|
Rules:
|
|
100
|
-
- `no-
|
|
114
|
+
- `no-deprecated-globals`
|
|
101
115
|
- Report usage of deprecated Nextcloud API
|
|
102
116
|
- Included as `warn` level in recommended configuration
|
|
103
117
|
- Available options
|
|
@@ -116,7 +130,7 @@ Rules:
|
|
|
116
130
|
parseAppInfo?: boolean
|
|
117
131
|
}
|
|
118
132
|
```
|
|
119
|
-
- `no-removed-
|
|
133
|
+
- `no-removed-globals`
|
|
120
134
|
- Report usage of removed Nextcloud API
|
|
121
135
|
- Included as `error` level in recommended configuration
|
|
122
136
|
- Available options
|
|
@@ -135,10 +149,102 @@ Rules:
|
|
|
135
149
|
parseAppInfo?: boolean
|
|
136
150
|
}
|
|
137
151
|
```
|
|
152
|
+
- `l10n-enforce-ellipsis`
|
|
153
|
+
- Enforce consistent usageof ellipsis instead of tripple dots
|
|
154
|
+
- Included as `error` level in recommended configuration
|
|
155
|
+
- `l10n-non-breaking-space`
|
|
156
|
+
- Enforce non-breaking spaces before ellipsis
|
|
157
|
+
- Included as `error` level in recommended configuration
|
|
158
|
+
|
|
159
|
+
#### Adding custom overrides
|
|
160
|
+
|
|
161
|
+
Sometimes additional rules need to be added for individual projects,
|
|
162
|
+
and while we do not recommend to override Nextcloud rules for code style (it should be consistent across all Nextcloud projects!),
|
|
163
|
+
it is possible to add such custom rules.
|
|
164
|
+
|
|
165
|
+
For example to enforce chains to be on separate lines:
|
|
166
|
+
|
|
167
|
+
```diff
|
|
168
|
+
- const a = foo().then((a) => a.b).catch((e) => e.c)
|
|
169
|
+
+ const a = foo()
|
|
170
|
+
+ .then((a) => a.b)
|
|
171
|
+
+ .catch((e) => e.c)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Adjust your `eslint.config.js` like this:
|
|
175
|
+
|
|
176
|
+
```js
|
|
177
|
+
import { recommended } from '@nextcloud/eslint-config'
|
|
178
|
+
|
|
179
|
+
export default [
|
|
180
|
+
...recommended,
|
|
181
|
+
{
|
|
182
|
+
rules: {
|
|
183
|
+
'@stylistic/newline-per-chained-call': ['error'],
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Update policy
|
|
190
|
+
|
|
191
|
+
We follow semantic versioning.
|
|
192
|
+
|
|
193
|
+
#### 💥 Breaking changes
|
|
194
|
+
|
|
195
|
+
For breaking changes, we consider those changes that break linting in a technical term, so linting itself is broken with the update.
|
|
196
|
+
This means, for example, require a new config format (ESLint legacy vs flat configuration). But it does not mean new errors or warnings while linting.
|
|
197
|
+
|
|
198
|
+
#### ✨ Minor changes
|
|
199
|
+
|
|
200
|
+
For minor changes we consider adding new rules or adding or removing plugins.
|
|
201
|
+
This means after updating a minor version, there can be new warnings or errors when linting the same code base.
|
|
202
|
+
|
|
203
|
+
#### 🐛 Patch changes
|
|
204
|
+
|
|
205
|
+
For this configuration we consider following changes fixes:
|
|
206
|
+
- Adjusting rules to follow our official code style.
|
|
207
|
+
- Adjusting rules if the current behavior is considered a bug.
|
|
208
|
+
- Removing rules
|
|
209
|
+
|
|
210
|
+
### Development
|
|
211
|
+
|
|
212
|
+
#### New rules
|
|
213
|
+
|
|
214
|
+
Adding new rules that enforce our code style can always be added.
|
|
215
|
+
Rules that are not directly covered by our code style should be discussed before.
|
|
216
|
+
|
|
217
|
+
If those rules are code style related, the matching section of the [Nextcloud developer documentation](https://github.com/nextcloud/documentation/) has to be updated to keep both in sync.
|
|
218
|
+
|
|
219
|
+
#### Rule severity
|
|
220
|
+
|
|
221
|
+
Either you care about a rule or you do not.
|
|
222
|
+
As such we only enforce rules that we consider either important for code quality or to have consistent code style.
|
|
223
|
+
For this reason all rules should be set to **error** severity, as all rules are considered must-follow.
|
|
224
|
+
|
|
225
|
+
Of course, in some edge cases rules do not apply, in such cases the users can still opt-in to disable that rule for a line or file.
|
|
226
|
+
|
|
227
|
+
To not break projects during updates new rules with non critical impact (code style related rules)
|
|
228
|
+
should be introduced with **warn** severity and moved to severity **error** only with a new major release or after a sane timeframe for migration.
|
|
138
229
|
|
|
139
|
-
|
|
230
|
+
#### Release new version
|
|
140
231
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
232
|
+
- Pull the latest changes from `main` or `stableX`
|
|
233
|
+
- Checkout a new branch with the tag name (e.g `v9.0.1`): `git checkout -b v<version>`
|
|
234
|
+
- Run `npm version patch --no-git-tag-version` (`npm version minor --no-git-tag-version` if minor).
|
|
235
|
+
This will return a new version name, make sure it matches what you expect
|
|
236
|
+
- Generate the changelog content from the [release](https://github.com/nextcloud-libraries/eslint-config/releases) page.
|
|
237
|
+
Create a draft release, select the previous tag, click `generate` then paste the content to the `CHANGELOG.md` file
|
|
238
|
+
1. adjust the links to the merged pull requests and authors so that the changelog also works outside of GitHub
|
|
239
|
+
by running `npm run prerelease:format-changelog`.
|
|
240
|
+
This will apply this regex: `by @([^ ]+) in ((https://github.com/)nextcloud-libraries/eslint-config/pull/(\d+))`
|
|
241
|
+
Which this as the replacement: `[\#$4]($2) \([$1]($3$1)\)`
|
|
242
|
+
2. use the the version as tag AND title (e.g `v4.0.1`)
|
|
243
|
+
3. add the changelog content as description (https://github.com/nextcloud-libraries/eslint-config/releases)
|
|
244
|
+
- Commit, push and create PR
|
|
245
|
+
- Get your PR reviewed and merged
|
|
246
|
+
- Create a milestone with the follow-up version at https://github.com/nextcloud-libraries/eslint-config/milestones
|
|
247
|
+
- Move all open tickets and PRs to the follow-up
|
|
248
|
+
- Close the milestone of the version you release
|
|
249
|
+
- Publish the previously drafted release on GitHub
|
|
250
|
+

|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
import type { Linter } from 'eslint';
|
|
6
|
+
import type { ConfigOptions } from '../types.d.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Config factory for general code style related rules
|
|
9
|
+
* See also: https://docs.nextcloud.com/server/latest/developer_manual/getting_started/coding_standards/javascript.html#code-style
|
|
10
|
+
*
|
|
11
|
+
* @param options options defining the config preset flavor
|
|
12
|
+
*/
|
|
13
|
+
export declare function codeStyle(options: ConfigOptions): Linter.Config[];
|