-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
127 lines (122 loc) · 3.97 KB
/
.eslintrc.js
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
module.exports = {
extends: [
'@nextcloud/eslint-config/typescript',
'plugin:vue/recommended',
],
parserOptions: {
ecmaVersion: 'latest',
},
globals: {
// Electron Forge build vars
AUTHENTICATION_WINDOW_WEBPACK_ENTRY: 'readonly',
AUTHENTICATION_WINDOW_PRELOAD_WEBPACK_ENTRY: 'readonly',
TALK_WINDOW_WEBPACK_ENTRY: 'readonly',
TALK_WINDOW_PRELOAD_WEBPACK_ENTRY: 'readonly',
HELP_WINDOW_WEBPACK_ENTRY: 'readonly',
HELP_WINDOW_PRELOAD_WEBPACK_ENTRY: 'readonly',
UPGRADE_WINDOW_WEBPACK_ENTRY: 'readonly',
UPGRADE_WINDOW_PRELOAD_WEBPACK_ENTRY: 'readonly',
WELCOME_WINDOW_WEBPACK_ENTRY: 'readonly',
WELCOME_WINDOW_PRELOAD_WEBPACK_ENTRY: 'readonly',
// Build constants
IS_DESKTOP: 'readonly',
},
settings: {
'import/extensions': [
'.js',
'.ts',
'.vue',
],
'import/ignore': [
// eslint-plugin-import doesn't support setting TS parser as options for vue parser
'\\.vue$',
],
},
rules: {
// import/default is not compatible with SFC Setup .vue files
// It works fine on server because by default in @nextcloud/eslint-config .vue files are not inspected via eslint-plugin-import thus import/extensions doesn't include .vue
// See: https://github.com/import-js/eslint-plugin-import/blob/main/README.md#importextensions
'import/default': 'off',
/**
* ESLint
*/
'no-console': 'off', // TODO: remove after preview
/**
* jsdoc
*
* @see https://github.com/gajus/eslint-plugin-jsdoc
*/
// 'jsdoc/require-param-description': 'off',
/**
* Node
*
* @see https://github.com/eslint-community/eslint-plugin-n/
*/
'n/no-unpublished-import': 'off',
'n/no-callback-literal': 'off', // conflicts with Electron API
'n/no-missing-import': 'off', // TODO: Find a way to configure @talk alias
'n/no-missing-require': 'off',
'n/no-extraneous-import': ['error', {
// These modules are resolved with Webpack Provide plugin
allowModules: [
'@nextcloud/auth',
'@nextcloud/axios',
'@nextcloud/initial-state',
'@nextcloud/notify_push',
'@nextcloud/router',
],
}],
/**
* import
*
* @see https://github.com/import-js/eslint-plugin-import
*/
'import/no-unresolved': 'off', // TODO: Find a way to configure @talk alias
/**
* Vue
*
* @see https://eslint.vuejs.org
*/
/** Vue / Priority A: Essentials */
// All rules enabled
// This rule is disabled in @nextcloud - re-enable
'vue/multi-word-component-names': 'error',
/** Vue / Priority B: Strongly Recommended */
// All Rules enabled
/** Vue / Priority C: Recommended */
// All Rules enabled
/** Vue / Uncategorized */
'vue/attribute-hyphenation': 'error',
'vue/block-order': ['error', { order: ['script', 'template', 'style'] }], // Follow new Vue standards
'vue/component-api-style': ['error', ['script-setup']], // Follow new Vue standards
'vue/component-name-in-template-casing': 'error',
'vue/component-options-name-casing': 'error',
// 'vue/custom-event-name-casing': 'error',
'vue/define-emits-declaration': 'error',
'vue/match-component-file-name': 'error',
// 'vue/no-bare-strings-in-template': 'error', // TODO: Enable with l10n
'vue/new-line-between-multi-line-property': 'error',
'vue/no-duplicate-attr-inheritance': 'error',
'vue/no-potential-component-option-typo': 'error',
'vue/no-ref-object-destructure': 'error',
'vue/no-undef-components': 'error',
'vue/no-undef-properties': 'error',
'vue/no-unused-properties': 'error', // TODO: Experiment
'vue/no-useless-mustaches': 'error',
'vue/no-useless-v-bind': 'error',
'vue/padding-line-between-blocks': 'error',
'vue/prefer-separate-static-class': 'error',
'vue/prefer-true-attribute-shorthand': 'error',
'vue/require-name-property': 'error',
/**
* Nextcloud
*/
// Talk Desktop doesn't use real Nextcloud server globals
'@nextcloud/no-deprecations': 'off',
'@nextcloud/no-removed-apis': 'off',
},
}