Skip to content

Commit 43dbc35

Browse files
committed
chore: adjust max array members in a single line to 3 items
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 0ae2dce commit 43dbc35

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

lib/configs/codeStyle.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,20 @@ export function codeStyle(options: ConfigOptions): Linter.Config[] {
101101
'@stylistic/object-curly-newline': 'off',
102102
'@stylistic/object-curly-spacing': 'off',
103103
'@stylistic/object-property-newline': 'off',
104-
'@stylistic/exp-list-style': 'error',
104+
'@stylistic/exp-list-style': ['error', {
105+
singleLine: {
106+
spacing: 'never',
107+
maxItems: 3,
108+
},
109+
multiLine: {
110+
minItems: 0,
111+
},
112+
overrides: {
113+
'{}': {
114+
singleLine: { spacing: 'always', maxItems: Number.POSITIVE_INFINITY },
115+
},
116+
},
117+
}],
105118

106119
// No space between function name and parenthesis. Enforce fn() instead of fn ()
107120
'@stylistic/function-call-spacing': [

lib/plugins/nextcloud-vue/rules/no-deprecated-props.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ export default {
5656
const isNcTextFieldArrowEndValid = versionSatisfies('8.28.0') // #7002
5757
const isCloseButtonOutsideValid = versionSatisfies('8.32.0') // #7553
5858

59-
const legacyTypes = ['primary', 'error', 'warning', 'success', 'secondary', 'tertiary', 'tertiary-no-background']
59+
const legacyTypes = [
60+
'primary',
61+
'error',
62+
'warning',
63+
'success',
64+
'secondary',
65+
'tertiary',
66+
'tertiary-no-background',
67+
]
6068

6169
return vueUtils.defineTemplateBodyVisitor(context, {
6270
'VElement VAttribute:has(VIdentifier[name="type"])': function(node) {

tests/fixtures/codestyle/output/array.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ const items = [
77
'second',
88
'third',
99
]
10-
const LATIN_VOWELS = ['a', 'e', 'i', 'o', 'u']
10+
const LATIN_VOWELS = [
11+
'a',
12+
'e',
13+
'i',
14+
'o',
15+
'u',
16+
]
1117

1218
// ❌ Multi-line array should have a single element per line to make it diff-safe and readable
1319
// Here the last two elements are on the same line
@@ -44,4 +50,12 @@ const USER_STATUSES = [
4450
'offline',
4551
]
4652
// 🚧 Currently this is an edge case and isn't fixed properly...
47-
const WEEKDAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
53+
const WEEKDAYS = [
54+
'Monday',
55+
'Tuesday',
56+
'Wednesday',
57+
'Thursday',
58+
'Friday',
59+
'Saturday',
60+
'Sunday',
61+
]

0 commit comments

Comments
 (0)