Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
97 lines (87 loc) · 2.33 KB
/
Copy patheslint.config.mjs
File metadata and controls
97 lines (87 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { recommendedJavascript } from '@nextcloud/eslint-config'
import pluginCypress from 'eslint-plugin-cypress'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
export default defineConfig(
...recommendedJavascript,
// JSDoc blocks are not expected to be complete, only accurate
{
name: 'richdocuments/partial-jsdoc',
rules: {
'jsdoc/check-values': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/valid-types': 'off',
},
},
// WOPI post message payloads and the config store are untyped by nature
{
name: 'richdocuments/untyped-payloads',
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
// Levelled console output is intentional, stray `console.log` is not
{
name: 'richdocuments/console',
rules: {
'no-console': ['error', { allow: ['debug', 'warn', 'error'] }],
},
},
// ts-loader rejects `.ts` import paths (TS5097) and cannot enable
// `allowImportingTsExtensions`, which requires `noEmit`
{
name: 'richdocuments/ts-import-extensions',
files: ['**/*.ts', '**/*.tsx'],
rules: {
'import-extensions/extensions': 'off',
},
},
// Pre-existing single-word view components, renaming them is a breaking change
{
name: 'richdocuments/legacy-component-names',
files: [
'src/components/Modal/Confirmation.vue',
'src/view/Office.vue',
'src/view/Viewer.vue',
],
rules: {
'vue/multi-word-component-names': 'off',
},
},
{
name: 'richdocuments/cypress',
files: ['cypress/**/*.js'],
extends: [pluginCypress.configs.globals],
},
// Build and tooling scripts are CommonJS and run in Node
{
name: 'richdocuments/scripts-are-cjs',
files: ['webpack.js', '.stylelintrc.js', 'cypress/plugins/**/*.js'],
languageOptions: {
sourceType: 'commonjs',
globals: { ...globals.node },
},
rules: {
'no-console': 'off',
'jsdoc/require-jsdoc': 'off',
},
},
// Development scripts are ES modules and run in Node
{
name: 'richdocuments/scripts-are-esm',
files: ['scripts/**/*.mjs'],
languageOptions: {
globals: { ...globals.node },
},
rules: {
'no-console': 'off',
'jsdoc/require-jsdoc': 'off',
},
},
)