@nextcloud/eslint-config 9.0.0-rc.3 → 9.0.0-rc.5
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 +6 -0
- package/dist/configs/filesystem.js +5 -7
- package/dist/configs/vue.js +8 -2
- package/dist/globs.js +4 -2
- package/dist/plugins/l10n/index.js +6 -6
- package/dist/plugins/l10n/rules/enforce-ellipsis-vue.d.ts +7 -0
- package/dist/plugins/l10n/rules/enforce-ellipsis-vue.js +13 -0
- package/dist/plugins/l10n/rules/enforce-ellipsis.js +19 -13
- package/dist/plugins/l10n/rules/index.d.ts +10 -0
- package/dist/plugins/l10n/rules/index.js +14 -0
- package/dist/plugins/l10n/rules/non-breaking-space-vue.d.ts +7 -0
- package/dist/plugins/l10n/rules/non-breaking-space-vue.js +13 -0
- package/dist/plugins/l10n/rules/non-breaking-space.js +4 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -25,6 +25,7 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
25
25
|
* 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)\)
|
|
26
26
|
* feat(imports): add custom plugin to suggest file extensions [\#1110](https://github.com/nextcloud-libraries/eslint-config/pull/1110) \([susnux](https://github.com/susnux)\)
|
|
27
27
|
* feat(filesystem): ignore all files within the `.gitignore` [\#1108](https://github.com/nextcloud-libraries/eslint-config/pull/1108) \([susnux](https://github.com/susnux)\)
|
|
28
|
+
* feat(l10n-plugin): also handle vue templates [\#1113](https://github.com/nextcloud-libraries/eslint-config/pull/1113) \([susnux](https://github.com/susnux)\)
|
|
28
29
|
|
|
29
30
|
### Fixed
|
|
30
31
|
* fix(codestyle): do not require splitting chains [\#951](https://github.com/nextcloud-libraries/eslint-config/pull/951)
|
|
@@ -53,6 +54,10 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
53
54
|
* fix(vue): also ignore the global router link component [\#1097](https://github.com/nextcloud-libraries/eslint-config/pull/1097) \([susnux](https://github.com/susnux)\)
|
|
54
55
|
* 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)\)
|
|
55
56
|
* fix(codestyle): replace deprecated config in `@stylistic/quotes` rule [\#1109](https://github.com/nextcloud-libraries/eslint-config/pull/1109) \([susnux](https://github.com/susnux)\)
|
|
57
|
+
* 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)\)
|
|
58
|
+
* fix(filesystem): relax ignored files [\#1114](https://github.com/nextcloud-libraries/eslint-config/pull/1114) \([susnux](https://github.com/susnux)\)
|
|
59
|
+
* fix(globs): adjust globs for test related files [\#1128](https://github.com/nextcloud-libraries/eslint-config/pull/1128) \([susnux](https://github.com/susnux)\)
|
|
60
|
+
* fix(vue): use vue variant of `no-irregular-whitespace` [\#1129](https://github.com/nextcloud-libraries/eslint-config/pull/1129) \([susnux](https://github.com/susnux)\)
|
|
56
61
|
|
|
57
62
|
### Changed
|
|
58
63
|
* Add SPDX header [#802](https://github.com/nextcloud-libraries/eslint-config/pull/802)
|
|
@@ -69,6 +74,7 @@ Please refer to the README on how to adjust your configuration for flat config.
|
|
|
69
74
|
* ci: update workflows from organization [#1047](https://github.com/nextcloud-libraries/eslint-config/pull/1047) ([susnux](https://github.com/susnux))
|
|
70
75
|
* chore: add active node version (24) to supported engines [#1066](https://github.com/nextcloud-libraries/eslint-config/pull/1066) ([susnux](https://github.com/susnux))
|
|
71
76
|
* build: add common changelog formatting and documentation for it [#1067](https://github.com/nextcloud-libraries/eslint-config/pull/1067) ([susnux](https://github.com/susnux))
|
|
77
|
+
* chore: lint this project as a library [\#1130](https://github.com/nextcloud-libraries/eslint-config/pull/1130) \([susnux](https://github.com/susnux)\)
|
|
72
78
|
* Updated `@eslint/json` to 0.12.0
|
|
73
79
|
* Updated `@stylistic/eslint-plugin` 4.2.0
|
|
74
80
|
* Updated `eslint-plugin-jsdoc` to 50.6.11
|
|
@@ -14,13 +14,11 @@ export const filesystem = [
|
|
|
14
14
|
{
|
|
15
15
|
name: 'nextcloud/filesystem/ignores',
|
|
16
16
|
ignores: [
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'**/vendor',
|
|
23
|
-
'**/vendor-bin',
|
|
17
|
+
'dist/',
|
|
18
|
+
'js/',
|
|
19
|
+
'l10n/',
|
|
20
|
+
'vendor/',
|
|
21
|
+
'vendor-bin/',
|
|
24
22
|
'**/package-lock.json',
|
|
25
23
|
],
|
|
26
24
|
},
|
package/dist/configs/vue.js
CHANGED
|
@@ -35,6 +35,7 @@ export function vue(options) {
|
|
|
35
35
|
: []),
|
|
36
36
|
{
|
|
37
37
|
files: GLOB_FILES_VUE,
|
|
38
|
+
name: 'nextcloud/vue/rules',
|
|
38
39
|
rules: {
|
|
39
40
|
// PascalCase components names for vuejs
|
|
40
41
|
'vue/component-name-in-template-casing': [
|
|
@@ -98,14 +99,20 @@ export function vue(options) {
|
|
|
98
99
|
'vue/no-unused-refs': 'warn',
|
|
99
100
|
// Warn on unused props
|
|
100
101
|
'vue/no-unused-properties': 'warn',
|
|
102
|
+
// This rule does not work in vue files, we must use the vue one
|
|
103
|
+
'no-irregular-whitespace': 'off',
|
|
104
|
+
'vue/no-irregular-whitespace': 'error',
|
|
101
105
|
},
|
|
102
|
-
name: 'nextcloud/vue/rules',
|
|
103
106
|
},
|
|
104
107
|
{
|
|
105
108
|
files: GLOB_FILES_VUE,
|
|
109
|
+
name: 'nextcloud/vue/stylistic-rules',
|
|
106
110
|
rules: {
|
|
107
111
|
// same as the stylistic rules but for the <template> in Vue files
|
|
108
112
|
...Object.fromEntries(vueStylisticRules),
|
|
113
|
+
// same as in the codeStyle config but for the <template> in Vue files
|
|
114
|
+
'@nextcloud-l10n/non-breaking-space-vue': 'error',
|
|
115
|
+
'@nextcloud-l10n/enforce-ellipsis-vue': 'error',
|
|
109
116
|
// Also enforce tabs for template
|
|
110
117
|
'vue/html-indent': [
|
|
111
118
|
'error',
|
|
@@ -131,7 +138,6 @@ export function vue(options) {
|
|
|
131
138
|
},
|
|
132
139
|
],
|
|
133
140
|
},
|
|
134
|
-
name: 'nextcloud/vue/stylistic-rules',
|
|
135
141
|
},
|
|
136
142
|
{
|
|
137
143
|
files: [
|
package/dist/globs.js
CHANGED
|
@@ -7,8 +7,10 @@ export const GLOB_FILES_TESTING = [
|
|
|
7
7
|
'**/*.test.*',
|
|
8
8
|
'**/*.spec.*',
|
|
9
9
|
'**/*.cy.*',
|
|
10
|
-
'**/test',
|
|
11
|
-
'**/tests',
|
|
10
|
+
'**/test/**',
|
|
11
|
+
'**/tests/**',
|
|
12
|
+
'**/__tests__/**',
|
|
13
|
+
'**/__mocks__/**',
|
|
12
14
|
];
|
|
13
15
|
/** Glob pattern for Typescript files */
|
|
14
16
|
export const GLOB_FILES_TYPESCRIPT = [
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
1
5
|
import { packageVersion } from "../../version.js";
|
|
2
|
-
import
|
|
3
|
-
import RuleNonBreakingSpace from "./rules/non-breaking-space.js";
|
|
6
|
+
import { rules } from "./rules/index.js";
|
|
4
7
|
/**
|
|
5
8
|
* ESLint plugin to enforce consistent translations
|
|
6
9
|
*/
|
|
@@ -9,9 +12,6 @@ const Plugin = {
|
|
|
9
12
|
name: '@nextcloud/l10n-plugin',
|
|
10
13
|
version: packageVersion,
|
|
11
14
|
},
|
|
12
|
-
rules
|
|
13
|
-
'non-breaking-space': RuleNonBreakingSpace,
|
|
14
|
-
'enforce-ellipsis': RuleEllipsis,
|
|
15
|
-
},
|
|
15
|
+
rules,
|
|
16
16
|
};
|
|
17
17
|
export default Plugin;
|
|
@@ -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 * as vueUtils from 'eslint-plugin-vue/lib/utils/index.js';
|
|
6
|
+
import enforceEllipsis from "./enforce-ellipsis.js";
|
|
7
|
+
const defineRule = (r) => r;
|
|
8
|
+
export default defineRule({
|
|
9
|
+
...enforceEllipsis,
|
|
10
|
+
create(context) {
|
|
11
|
+
return vueUtils.defineTemplateBodyVisitor(context, enforceEllipsis.create(context));
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -7,24 +7,30 @@ export default defineRule({
|
|
|
7
7
|
docs: {
|
|
8
8
|
description: 'Enforce consistent usageof ellipsis instead of tripple dots',
|
|
9
9
|
},
|
|
10
|
+
messages: {
|
|
11
|
+
shoudUseEllipsis: 'Translated strings should use ellipsis character instead of triple dots',
|
|
12
|
+
},
|
|
10
13
|
},
|
|
11
14
|
create(context) {
|
|
12
15
|
return {
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|| node.
|
|
16
|
-
|| node.parent.callee.type !== 'Identifier'
|
|
17
|
-
|| node.parent.callee.name !== 't') {
|
|
16
|
+
CallExpression(node) {
|
|
17
|
+
if (node.callee.type !== 'Identifier'
|
|
18
|
+
|| (node.callee.name !== 't' && node.callee.name !== 'n')) {
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
for (const argument of node.arguments) {
|
|
22
|
+
if (argument.type !== 'Literal') {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (argument.raw?.match(/(?<=[^.])\.\.\.(?!\.)/)) {
|
|
26
|
+
context.report({
|
|
27
|
+
node,
|
|
28
|
+
messageId: 'shoudUseEllipsis',
|
|
29
|
+
fix(fixer) {
|
|
30
|
+
return fixer.replaceText(argument, argument.raw.replaceAll(/(?<=[^.])\.\.\.(?!\.)/g, '…'));
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
},
|
|
30
36
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
export declare const rules: {
|
|
6
|
+
'enforce-ellipsis': import("eslint").Rule.RuleModule;
|
|
7
|
+
'enforce-ellipsis-vue': import("eslint").Rule.RuleModule;
|
|
8
|
+
'non-breaking-space': import("eslint").Rule.RuleModule;
|
|
9
|
+
'non-breaking-space-vue': import("eslint").Rule.RuleModule;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
import enforceEllipsisVue from "./enforce-ellipsis-vue.js";
|
|
6
|
+
import enforceEllipsis from "./enforce-ellipsis.js";
|
|
7
|
+
import nonBreakingSpaceVue from "./non-breaking-space-vue.js";
|
|
8
|
+
import nonBreakingSpace from "./non-breaking-space.js";
|
|
9
|
+
export const rules = {
|
|
10
|
+
'enforce-ellipsis': enforceEllipsis,
|
|
11
|
+
'enforce-ellipsis-vue': enforceEllipsisVue,
|
|
12
|
+
'non-breaking-space': nonBreakingSpace,
|
|
13
|
+
'non-breaking-space-vue': nonBreakingSpaceVue,
|
|
14
|
+
};
|
|
@@ -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 * as vueUtils from 'eslint-plugin-vue/lib/utils/index.js';
|
|
6
|
+
import nonBreakingSpace from "./non-breaking-space.js";
|
|
7
|
+
const defineRule = (r) => r;
|
|
8
|
+
export default defineRule({
|
|
9
|
+
...nonBreakingSpace,
|
|
10
|
+
create(context) {
|
|
11
|
+
return vueUtils.defineTemplateBodyVisitor(context, nonBreakingSpace.create(context));
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -7,6 +7,9 @@ export default defineRule({
|
|
|
7
7
|
docs: {
|
|
8
8
|
description: 'Enforce non-breaking spaces before ellipsis',
|
|
9
9
|
},
|
|
10
|
+
messages: {
|
|
11
|
+
precedeWithNonbreakingSpace: 'Ellipsis must be preceded by non-breaking spaces',
|
|
12
|
+
},
|
|
10
13
|
},
|
|
11
14
|
create(context) {
|
|
12
15
|
return {
|
|
@@ -18,7 +21,7 @@ export default defineRule({
|
|
|
18
21
|
if (matches && matches[1] !== ' ') {
|
|
19
22
|
context.report({
|
|
20
23
|
node,
|
|
21
|
-
|
|
24
|
+
messageId: 'precedeWithNonbreakingSpace',
|
|
22
25
|
fix(fixer) {
|
|
23
26
|
return fixer.replaceText(node, node.raw.replaceAll(/\s+…/g, ' …'));
|
|
24
27
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextcloud/eslint-config",
|
|
3
|
-
"version": "9.0.0-rc.
|
|
3
|
+
"version": "9.0.0-rc.5",
|
|
4
4
|
"description": "Eslint shared config for nextcloud apps and libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@eslint/json": "^0.13.1",
|
|
47
|
-
"@stylistic/eslint-plugin": "^5.2.
|
|
47
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
48
48
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
49
49
|
"eslint-plugin-antfu": "^3.1.1",
|
|
50
|
-
"eslint-plugin-jsdoc": "^
|
|
50
|
+
"eslint-plugin-jsdoc": "^53.0.1",
|
|
51
51
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
52
|
-
"eslint-plugin-vue": "^10.
|
|
52
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
53
53
|
"fast-xml-parser": "^5.2.5",
|
|
54
54
|
"globals": "^16.3.0",
|
|
55
55
|
"semver": "^7.7.2",
|
|
56
56
|
"sort-package-json": "^3.4.0",
|
|
57
|
-
"typescript-eslint": "^8.
|
|
57
|
+
"typescript-eslint": "^8.39.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "^24.1
|
|
60
|
+
"@types/node": "^24.2.1",
|
|
61
61
|
"@types/semver": "^7.7.0",
|
|
62
|
-
"eslint": "^9.
|
|
63
|
-
"memfs": "^4.
|
|
62
|
+
"eslint": "^9.33.0",
|
|
63
|
+
"memfs": "^4.36.0",
|
|
64
64
|
"vitest": "^3.2.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|