@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import { GLOB_FILES_TESTING } from "../globs.js";
|
|
3
|
+
/**
|
|
4
|
+
* Config setup for the node environment.
|
|
5
|
+
* Config files should be parsed as Node.JS scripts with Node globals etc.
|
|
6
|
+
*/
|
|
7
|
+
export const node = [
|
|
8
|
+
{
|
|
9
|
+
name: 'nextcloud/node/setup',
|
|
10
|
+
files: [
|
|
11
|
+
'**/*.config.*',
|
|
12
|
+
'**/*.cjs',
|
|
13
|
+
'**/*.cts',
|
|
14
|
+
...GLOB_FILES_TESTING,
|
|
15
|
+
],
|
|
16
|
+
languageOptions: {
|
|
17
|
+
globals: {
|
|
18
|
+
...globals.es2023,
|
|
19
|
+
...globals.node,
|
|
20
|
+
...globals.nodeBuiltin,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* Typescript related ESLint rules for Nextcloud
|
|
9
|
+
*
|
|
10
|
+
* @param options options defining the config preset flavor
|
|
11
|
+
*/
|
|
12
|
+
export declare function typescript(options: ConfigOptions): Linter.Config[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import typescriptPlugin from 'typescript-eslint';
|
|
2
|
+
import { GLOB_FILES_TESTING, GLOB_FILES_TYPESCRIPT, GLOB_FILES_TYPESCRIPT_DECLARATIONS, GLOB_FILES_VUE, } from "../globs.js";
|
|
3
|
+
import { restrictConfigFiles } from "../utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Typescript related ESLint rules for Nextcloud
|
|
6
|
+
*
|
|
7
|
+
* @param options options defining the config preset flavor
|
|
8
|
+
*/
|
|
9
|
+
export function typescript(options) {
|
|
10
|
+
return [
|
|
11
|
+
...restrictConfigFiles(typescriptPlugin.configs.recommended, [
|
|
12
|
+
...GLOB_FILES_TYPESCRIPT,
|
|
13
|
+
...(options.vueIsTypescript ? GLOB_FILES_VUE : []),
|
|
14
|
+
]),
|
|
15
|
+
{
|
|
16
|
+
name: 'nextcloud/typescript/rules',
|
|
17
|
+
files: [
|
|
18
|
+
...GLOB_FILES_TYPESCRIPT,
|
|
19
|
+
...(options.vueIsTypescript ? GLOB_FILES_VUE : []),
|
|
20
|
+
],
|
|
21
|
+
rules: {
|
|
22
|
+
// Do not allow to import types with `import` but require `import type`
|
|
23
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
24
|
+
// Allow expect-error as we can sometimes not prevent it...
|
|
25
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
'ts-expect-error': 'allow-with-description',
|
|
29
|
+
minimumDescriptionLength: 9,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
// No nullish coalescing if left side can not be nullish
|
|
33
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
34
|
+
// Do not use types, variables etc before they are defined
|
|
35
|
+
'no-use-before-define': 'off',
|
|
36
|
+
'@typescript-eslint/no-use-before-define': [
|
|
37
|
+
'error',
|
|
38
|
+
{
|
|
39
|
+
functions: false,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'nextcloud/typescript/declaration-rules',
|
|
46
|
+
files: [...GLOB_FILES_TYPESCRIPT_DECLARATIONS],
|
|
47
|
+
rules: {
|
|
48
|
+
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
files: GLOB_FILES_TESTING,
|
|
53
|
+
rules: {
|
|
54
|
+
// Allow "any" in tests
|
|
55
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
56
|
+
},
|
|
57
|
+
name: 'nextcloud/typescript/test-rules',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* General vue related rules for both versions
|
|
9
|
+
*
|
|
10
|
+
* @param options options defining the config preset flavor
|
|
11
|
+
*/
|
|
12
|
+
export declare function vue(options: ConfigOptions): Linter.Config[];
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
2
|
+
import { GLOB_FILES_JAVASCRIPT, GLOB_FILES_TYPESCRIPT, GLOB_FILES_VUE, } from "../globs.js";
|
|
3
|
+
import { nextcloudPlugin } from "../index.js";
|
|
4
|
+
import { codeStyle } from "./codeStyle.js";
|
|
5
|
+
const stylisticRules = codeStyle({
|
|
6
|
+
isLibrary: false,
|
|
7
|
+
vueIsTypescript: false,
|
|
8
|
+
}).reduce((rules, config) => ({
|
|
9
|
+
...rules,
|
|
10
|
+
...(config.rules ?? {}),
|
|
11
|
+
}), {});
|
|
12
|
+
const vueStylisticRules = Object.keys(vuePlugin.rules)
|
|
13
|
+
.filter((rule) => `@stylistic/${rule}` in stylisticRules)
|
|
14
|
+
.map((rule) => [
|
|
15
|
+
`vue/${rule}`,
|
|
16
|
+
stylisticRules[`@stylistic/${rule}`],
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* General vue related rules for both versions
|
|
20
|
+
*
|
|
21
|
+
* @param options options defining the config preset flavor
|
|
22
|
+
*/
|
|
23
|
+
export function vue(options) {
|
|
24
|
+
return [
|
|
25
|
+
...(options.vueIsTypescript
|
|
26
|
+
? [
|
|
27
|
+
{
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parserOptions: {
|
|
30
|
+
parser: '@typescript-eslint/parser',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
: []),
|
|
36
|
+
{
|
|
37
|
+
files: GLOB_FILES_VUE,
|
|
38
|
+
name: 'nextcloud/vue/rules',
|
|
39
|
+
rules: {
|
|
40
|
+
// PascalCase components names in template tag names
|
|
41
|
+
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
42
|
+
// Also in registration
|
|
43
|
+
'vue/component-options-name-casing': ['error', 'PascalCase'],
|
|
44
|
+
// space before self-closing elements
|
|
45
|
+
'vue/html-closing-bracket-spacing': 'error',
|
|
46
|
+
// no ending html tag on a new line
|
|
47
|
+
'vue/html-closing-bracket-newline': [
|
|
48
|
+
'error',
|
|
49
|
+
{
|
|
50
|
+
multiline: 'never',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
// Enforce documentation of properties
|
|
54
|
+
'vue/require-prop-comment': options.isLibrary
|
|
55
|
+
? [
|
|
56
|
+
'error',
|
|
57
|
+
{
|
|
58
|
+
type: 'JSDoc',
|
|
59
|
+
},
|
|
60
|
+
]
|
|
61
|
+
: 'off',
|
|
62
|
+
// When a prop allows Boolean and some other type, then Boolean should come first to allow short-hand properties
|
|
63
|
+
'vue/prefer-prop-type-boolean-first': 'error',
|
|
64
|
+
// Prevent useless string interpolation where not needed
|
|
65
|
+
'vue/no-useless-mustaches': 'error',
|
|
66
|
+
// If there is a default then it is not required - this is either way a bug
|
|
67
|
+
'vue/no-required-prop-with-default': 'error',
|
|
68
|
+
// Omit empty blocks
|
|
69
|
+
'vue/no-empty-component-block': 'error',
|
|
70
|
+
// Boolean properties should behave like HTML properties
|
|
71
|
+
'vue/no-boolean-default': [
|
|
72
|
+
'warn',
|
|
73
|
+
'default-false',
|
|
74
|
+
],
|
|
75
|
+
// Allow 3 attributes on the same line if singe line
|
|
76
|
+
'vue/max-attributes-per-line': [
|
|
77
|
+
'error',
|
|
78
|
+
{
|
|
79
|
+
singleline: {
|
|
80
|
+
max: 3,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
// Component names should match their export names - readability and maintainability ("where does this component come from?")
|
|
85
|
+
'vue/match-component-import-name': 'error',
|
|
86
|
+
'vue/match-component-file-name': 'error',
|
|
87
|
+
// Prevent useless v-bind like `<foo :bar="'bar'"/>`
|
|
88
|
+
'vue/no-useless-v-bind': 'error',
|
|
89
|
+
// Warn on undefined components - we need this on warning level as long as people use mixins (then we can move to error)
|
|
90
|
+
'vue/no-undef-components': [
|
|
91
|
+
'warn',
|
|
92
|
+
{
|
|
93
|
+
// Ignore the router link and view as this is (most often) globally registered
|
|
94
|
+
ignorePatterns: ['RouterLink', 'RouterView'],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
// Warn on unused refs
|
|
98
|
+
'vue/no-unused-refs': 'warn',
|
|
99
|
+
// Warn on unused props
|
|
100
|
+
'vue/no-unused-properties': 'warn',
|
|
101
|
+
// This rule does not work in vue files, we must use the vue one
|
|
102
|
+
'no-irregular-whitespace': 'off',
|
|
103
|
+
'vue/no-irregular-whitespace': 'error',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
files: GLOB_FILES_VUE,
|
|
108
|
+
name: 'nextcloud/vue/stylistic-rules',
|
|
109
|
+
rules: {
|
|
110
|
+
// same as the stylistic rules but for the <template> in Vue files
|
|
111
|
+
...Object.fromEntries(vueStylisticRules),
|
|
112
|
+
// same as in the codeStyle config but for the <template> in Vue files
|
|
113
|
+
'@nextcloud/l10n-non-breaking-space': 'error',
|
|
114
|
+
'@nextcloud/l10n-enforce-ellipsis': 'error',
|
|
115
|
+
// Also enforce tabs for template
|
|
116
|
+
'vue/html-indent': [
|
|
117
|
+
'error',
|
|
118
|
+
'tab',
|
|
119
|
+
],
|
|
120
|
+
// Consistent style of props
|
|
121
|
+
'vue/new-line-between-multi-line-property': 'error',
|
|
122
|
+
// Add consistent padding between blocks
|
|
123
|
+
'vue/padding-line-between-blocks': 'error',
|
|
124
|
+
// Prefer separated static and dynamic class attributes
|
|
125
|
+
'vue/prefer-separate-static-class': 'error',
|
|
126
|
+
// For consistent layout of components
|
|
127
|
+
'vue/define-macros-order': [
|
|
128
|
+
'error',
|
|
129
|
+
{
|
|
130
|
+
order: [
|
|
131
|
+
'defineOptions',
|
|
132
|
+
'defineModel',
|
|
133
|
+
'defineProps',
|
|
134
|
+
'defineEmits',
|
|
135
|
+
'defineSlots',
|
|
136
|
+
'defineExpose',
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
files: [
|
|
144
|
+
...GLOB_FILES_JAVASCRIPT,
|
|
145
|
+
...GLOB_FILES_TYPESCRIPT,
|
|
146
|
+
...GLOB_FILES_VUE,
|
|
147
|
+
],
|
|
148
|
+
plugins: {
|
|
149
|
+
'@nextcloud': nextcloudPlugin,
|
|
150
|
+
},
|
|
151
|
+
rules: {
|
|
152
|
+
'@nextcloud/no-deprecated-library-exports': 'error',
|
|
153
|
+
'@nextcloud/no-deprecated-library-props': 'error',
|
|
154
|
+
},
|
|
155
|
+
name: 'nextcloud/vue/migration-rules',
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* Vue2 related ESLint rules for Nextcloud
|
|
9
|
+
*
|
|
10
|
+
* @param option options defining the config preset flavor
|
|
11
|
+
*/
|
|
12
|
+
export declare function vue2(option: ConfigOptions): Linter.Config[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
2
|
+
import { GLOB_FILES_VUE } from "../globs.js";
|
|
3
|
+
import { restrictConfigFiles } from "../utils.js";
|
|
4
|
+
import { vue } from "./vue.js";
|
|
5
|
+
/**
|
|
6
|
+
* Vue2 related ESLint rules for Nextcloud
|
|
7
|
+
*
|
|
8
|
+
* @param option options defining the config preset flavor
|
|
9
|
+
*/
|
|
10
|
+
export function vue2(option) {
|
|
11
|
+
return [
|
|
12
|
+
...restrictConfigFiles(vuePlugin.configs['flat/vue2-recommended'], GLOB_FILES_VUE),
|
|
13
|
+
...vue(option),
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
// Force kebab-case for custom event name definitions (recommended by Vue 2 documentation)
|
|
17
|
+
'vue/custom-event-name-casing': [
|
|
18
|
+
'error',
|
|
19
|
+
'kebab-case',
|
|
20
|
+
{
|
|
21
|
+
// Allow namespace formats namespace:event
|
|
22
|
+
ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
files: GLOB_FILES_VUE,
|
|
27
|
+
name: 'nextcloud/vue2/rules',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* Vue3 related ESLint rules for Nextcloud
|
|
9
|
+
*
|
|
10
|
+
* @param options options defining the config preset flavor
|
|
11
|
+
*/
|
|
12
|
+
export declare function vue3(options: ConfigOptions): Linter.Config[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
6
|
+
import { GLOB_FILES_VUE } from "../globs.js";
|
|
7
|
+
import { restrictConfigFiles } from "../utils.js";
|
|
8
|
+
import { vue } from "./vue.js";
|
|
9
|
+
/**
|
|
10
|
+
* Vue3 related ESLint rules for Nextcloud
|
|
11
|
+
*
|
|
12
|
+
* @param options options defining the config preset flavor
|
|
13
|
+
*/
|
|
14
|
+
export function vue3(options) {
|
|
15
|
+
return [
|
|
16
|
+
...restrictConfigFiles(vuePlugin.configs['flat/recommended'], GLOB_FILES_VUE),
|
|
17
|
+
...vue(options),
|
|
18
|
+
// Vue3 specific overrides
|
|
19
|
+
{
|
|
20
|
+
files: GLOB_FILES_VUE,
|
|
21
|
+
rules: {
|
|
22
|
+
// Force camelCase in props/attrs for consistency with <script> and prevent tooling issues
|
|
23
|
+
'vue/attribute-hyphenation': ['error', 'never'],
|
|
24
|
+
// Force camelCase for custom event name definitions (recommended by Vue 3 documentation and consistent with JS)
|
|
25
|
+
'vue/custom-event-name-casing': [
|
|
26
|
+
'error',
|
|
27
|
+
'camelCase',
|
|
28
|
+
{
|
|
29
|
+
// Allow namespace formats namespace:event
|
|
30
|
+
ignores: ['/^[a-z]+:[a-z]+$/iu'],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
// Force camelCase for events in template for consistency with <script>
|
|
34
|
+
'vue/v-on-event-hyphenation': ['error', 'never', { autofix: true }],
|
|
35
|
+
// Force camelCase for slot names.
|
|
36
|
+
// Changing case is breaking for component users.
|
|
37
|
+
// For libraries it may result in a breaking change. Warn to prevent unintended breaking change.
|
|
38
|
+
// TODO: allow namespace:slotName format like in events
|
|
39
|
+
'vue/slot-name-casing': [options.isLibrary ? 'warn' : 'error', 'camelCase'],
|
|
40
|
+
// Deprecated thus we should not use it
|
|
41
|
+
'vue/no-deprecated-delete-set': 'error',
|
|
42
|
+
// When using script-setup the modern approach should be used
|
|
43
|
+
'vue/prefer-define-options': 'error',
|
|
44
|
+
},
|
|
45
|
+
name: 'nextcloud/vue3/rules',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
}
|
package/dist/globs.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
/** Glob pattern for test files (specs) */
|
|
6
|
+
export declare const GLOB_FILES_TESTING: string[];
|
|
7
|
+
/** Glob pattern for Typescript files */
|
|
8
|
+
export declare const GLOB_FILES_TYPESCRIPT: string[];
|
|
9
|
+
/** Glob pattern for Typescript declaration files */
|
|
10
|
+
export declare const GLOB_FILES_TYPESCRIPT_DECLARATIONS: string[];
|
|
11
|
+
/** Glob pattern for Javascript files */
|
|
12
|
+
export declare const GLOB_FILES_JAVASCRIPT: string[];
|
|
13
|
+
/** Glob pattern for JSON files */
|
|
14
|
+
export declare const GLOB_FILES_JSON: string[];
|
|
15
|
+
/** Glob pattern for JSONC files */
|
|
16
|
+
export declare const GLOB_FILES_JSONC: string[];
|
|
17
|
+
/** Glob pattern for Microsoft JSON files which use a slightly different JSONC implementation */
|
|
18
|
+
export declare const GLOB_FILES_MS_JSON: string[];
|
|
19
|
+
/** Glob pattern for Vue.JS files */
|
|
20
|
+
export declare const GLOB_FILES_VUE: string[];
|
package/dist/globs.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
/** Glob pattern for test files (specs) */
|
|
6
|
+
export const GLOB_FILES_TESTING = [
|
|
7
|
+
'**/*.test.*',
|
|
8
|
+
'**/*.spec.*',
|
|
9
|
+
'**/*.cy.*',
|
|
10
|
+
'**/test/**',
|
|
11
|
+
'**/tests/**',
|
|
12
|
+
'**/__tests__/**',
|
|
13
|
+
'**/__mocks__/**',
|
|
14
|
+
];
|
|
15
|
+
/** Glob pattern for Typescript files */
|
|
16
|
+
export const GLOB_FILES_TYPESCRIPT = [
|
|
17
|
+
'**/*.ts',
|
|
18
|
+
'**/*.mts',
|
|
19
|
+
'**/*.cts',
|
|
20
|
+
'**/*.tsx',
|
|
21
|
+
];
|
|
22
|
+
/** Glob pattern for Typescript declaration files */
|
|
23
|
+
export const GLOB_FILES_TYPESCRIPT_DECLARATIONS = ['**/*.d.ts'];
|
|
24
|
+
/** Glob pattern for Javascript files */
|
|
25
|
+
export const GLOB_FILES_JAVASCRIPT = [
|
|
26
|
+
'**/*.js',
|
|
27
|
+
'**/*.cjs',
|
|
28
|
+
'**/*.mjs',
|
|
29
|
+
'**/*.jsx',
|
|
30
|
+
];
|
|
31
|
+
/** Glob pattern for JSON files */
|
|
32
|
+
export const GLOB_FILES_JSON = ['**/*.json'];
|
|
33
|
+
/** Glob pattern for JSONC files */
|
|
34
|
+
export const GLOB_FILES_JSONC = ['**/*.jsonc'];
|
|
35
|
+
/** Glob pattern for Microsoft JSON files which use a slightly different JSONC implementation */
|
|
36
|
+
export const GLOB_FILES_MS_JSON = [
|
|
37
|
+
'**/tsconfig.json',
|
|
38
|
+
'.vscode/*.json',
|
|
39
|
+
];
|
|
40
|
+
/** Glob pattern for Vue.JS files */
|
|
41
|
+
export const GLOB_FILES_VUE = ['**/*.vue'];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Nextcloud shared configuration for projects using Vue
|
|
28
|
-
*/
|
|
29
|
-
export declare const
|
|
30
|
-
|
|
31
|
-
export { }
|
|
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
|
+
/**
|
|
7
|
+
* Nextcloud shared configuration for projects using Vue 2 with Javascript <script> blocks
|
|
8
|
+
*/
|
|
9
|
+
export declare const recommendedVue2Javascript: Linter.Config[];
|
|
10
|
+
/**
|
|
11
|
+
* Nextcloud shared configuration for projects using Vue 2 with Typescript <script> blocks
|
|
12
|
+
*/
|
|
13
|
+
export declare const recommendedVue2: Linter.Config[];
|
|
14
|
+
/**
|
|
15
|
+
* Nextcloud shared configuration for projects using Vue 3 with Javascript <script> blocks
|
|
16
|
+
*/
|
|
17
|
+
export declare const recommendedJavascript: Linter.Config[];
|
|
18
|
+
/**
|
|
19
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
20
|
+
*/
|
|
21
|
+
export declare const recommended: Linter.Config[];
|
|
22
|
+
/**
|
|
23
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
24
|
+
*/
|
|
25
|
+
export declare const recommendedLibrary: Linter.Config[];
|
|
26
|
+
/**
|
|
27
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
28
|
+
*/
|
|
29
|
+
export declare const recommendedVue2Library: Linter.Config[];
|
|
30
|
+
export { default as packageJsonPlugin } from './plugins/packageJson.ts';
|
|
31
|
+
export { default as nextcloudPlugin } from './plugins/nextcloud/index.ts';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
import { codeStyle } from "./configs/codeStyle.js";
|
|
6
|
+
import { documentation } from "./configs/documentation.js";
|
|
7
|
+
import { filesystem } from "./configs/filesystem.js";
|
|
8
|
+
import { imports } from "./configs/imports.js";
|
|
9
|
+
import { javascript } from "./configs/javascript.js";
|
|
10
|
+
import { json } from "./configs/json.js";
|
|
11
|
+
import { node } from "./configs/node.js";
|
|
12
|
+
import { typescript } from "./configs/typescript.js";
|
|
13
|
+
import { vue2 } from "./configs/vue2.js";
|
|
14
|
+
import { vue3 } from "./configs/vue3.js";
|
|
15
|
+
/**
|
|
16
|
+
* Nextcloud shared configuration for projects using Vue 2 with Javascript <script> blocks
|
|
17
|
+
*/
|
|
18
|
+
export const recommendedVue2Javascript = createConfig({
|
|
19
|
+
isLibrary: false,
|
|
20
|
+
vue2: true,
|
|
21
|
+
vueIsTypescript: false,
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Nextcloud shared configuration for projects using Vue 2 with Typescript <script> blocks
|
|
25
|
+
*/
|
|
26
|
+
export const recommendedVue2 = createConfig({
|
|
27
|
+
isLibrary: false,
|
|
28
|
+
vue2: true,
|
|
29
|
+
vueIsTypescript: true,
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Nextcloud shared configuration for projects using Vue 3 with Javascript <script> blocks
|
|
33
|
+
*/
|
|
34
|
+
export const recommendedJavascript = createConfig({
|
|
35
|
+
isLibrary: false,
|
|
36
|
+
vueIsTypescript: false,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
40
|
+
*/
|
|
41
|
+
export const recommended = createConfig({
|
|
42
|
+
isLibrary: false,
|
|
43
|
+
vueIsTypescript: true,
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
47
|
+
*/
|
|
48
|
+
export const recommendedLibrary = createConfig({
|
|
49
|
+
isLibrary: true,
|
|
50
|
+
vueIsTypescript: true,
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Nextcloud shared configuration for projects using Vue 3 with Typescript <script> blocks
|
|
54
|
+
*/
|
|
55
|
+
export const recommendedVue2Library = createConfig({
|
|
56
|
+
isLibrary: true,
|
|
57
|
+
vue2: true,
|
|
58
|
+
vueIsTypescript: true,
|
|
59
|
+
});
|
|
60
|
+
export { default as packageJsonPlugin } from "./plugins/packageJson.js";
|
|
61
|
+
export { default as nextcloudPlugin } from "./plugins/nextcloud/index.js";
|
|
62
|
+
/**
|
|
63
|
+
* Generate a configuration based on given options
|
|
64
|
+
*
|
|
65
|
+
* @param options - Configuration options
|
|
66
|
+
*/
|
|
67
|
+
function createConfig(options) {
|
|
68
|
+
return [
|
|
69
|
+
...filesystem,
|
|
70
|
+
...javascript(options),
|
|
71
|
+
...json,
|
|
72
|
+
...node,
|
|
73
|
+
...typescript(options),
|
|
74
|
+
...(options.vue2
|
|
75
|
+
? vue2(options)
|
|
76
|
+
: vue3(options)),
|
|
77
|
+
...documentation(options),
|
|
78
|
+
...imports(options),
|
|
79
|
+
...codeStyle(options),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: {
|
|
6
|
+
rules: {
|
|
7
|
+
'ban-inline-type-imports': import("eslint").Rule.RuleModule;
|
|
8
|
+
extensions: import("eslint").Rule.RuleModule;
|
|
9
|
+
};
|
|
10
|
+
meta: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -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 { packageVersion } from "../../version.js";
|
|
6
|
+
import { rules } from "./rules/index.js";
|
|
7
|
+
export default {
|
|
8
|
+
rules,
|
|
9
|
+
meta: {
|
|
10
|
+
name: '@nextcloud/eslint-plugin',
|
|
11
|
+
version: packageVersion,
|
|
12
|
+
},
|
|
13
|
+
};
|