-
Notifications
You must be signed in to change notification settings - Fork 441
/
.eslintrc.js
95 lines (95 loc) · 2.37 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
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
module.exports = {
extends: [
'@nextcloud/eslint-config/vue3',
],
globals: {
// @nextcloud/webpack-vue-config globals
appName: 'readonly',
appVersion: 'readonly',
// Desktop build globals
IS_DESKTOP: 'readonly',
},
rules: {
'comma-dangle': 'off',
'jsdoc/no-defaults': 'off',
'@typescript-eslint/no-unused-vars': 'off',
// Forbid import without extension even when TS is used
// TODO: fix in @nextcloud/eslint-config/typescript
'import/extensions': 'error',
'import/newline-after-import': 'error',
'import/no-named-as-default-member': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'unknown'],
pathGroups: [
{
// group all style imports at the end
pattern: '{*.css,*.scss}',
patternOptions: { matchBase: true },
group: 'unknown',
position: 'after',
},
{
// group material design icons
pattern: 'vue-material-design-icons/**',
group: 'external',
position: 'after',
},
{
// group @nextcloud imports
pattern: '@nextcloud/{!(vue),!(vue)/**}',
group: 'external',
position: 'after',
},
{
// group @nextcloud/vue imports
pattern: '{@nextcloud/vue,@nextcloud/vue/**}',
group: 'external',
position: 'after',
},
{
// group project components
pattern: '*.vue',
patternOptions: { matchBase: true },
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['@nextcloud', 'vue-material-design-icons'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
'import/no-unresolved': ['error', {
// Ignore Webpack query parameters, not supported by eslint-plugin-import
// https://github.com/import-js/eslint-plugin-import/issues/2562
ignore: ['\\?raw$'],
}],
},
overrides: [
{
files: ['**/*.spec.js'],
rules: {
'node/no-unpublished-import': 'off',
},
},
{
files: ['src/types/openapi/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
quotes: 'off',
'no-multiple-empty-lines': 'off',
'no-use-before-define': 'off',
},
},
],
}