Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/configs/codeStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,20 @@ export function codeStyle(options: ConfigOptions): Linter.Config[] {
'@stylistic/object-curly-newline': 'off',
'@stylistic/object-curly-spacing': 'off',
'@stylistic/object-property-newline': 'off',
'@stylistic/exp-list-style': 'error',
'@stylistic/exp-list-style': ['error', {
singleLine: {
spacing: 'never',
maxItems: 3,
},
multiLine: {
minItems: 0,
},
overrides: {
'{}': {
singleLine: { spacing: 'always', maxItems: Number.POSITIVE_INFINITY },
},
},
}],

// No space between function name and parenthesis. Enforce fn() instead of fn ()
'@stylistic/function-call-spacing': [
Expand Down
10 changes: 9 additions & 1 deletion lib/plugins/nextcloud-vue/rules/no-deprecated-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ export default {
const isNcTextFieldArrowEndValid = versionSatisfies('8.28.0') // #7002
const isCloseButtonOutsideValid = versionSatisfies('8.32.0') // #7553

const legacyTypes = ['primary', 'error', 'warning', 'success', 'secondary', 'tertiary', 'tertiary-no-background']
const legacyTypes = [
'primary',
'error',
'warning',
'success',
'secondary',
'tertiary',
'tertiary-no-background',
]

return vueUtils.defineTemplateBodyVisitor(context, {
'VElement VAttribute:has(VIdentifier[name="type"])': function(node) {
Expand Down
18 changes: 16 additions & 2 deletions tests/fixtures/codestyle/output/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ const items = [
'second',
'third',
]
const LATIN_VOWELS = ['a', 'e', 'i', 'o', 'u']
const LATIN_VOWELS = [
'a',
'e',
'i',
'o',
'u',
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need diff-safe here? I don't think new vowels are expected to be added 👀


// ❌ Multi-line array should have a single element per line to make it diff-safe and readable
// Here the last two elements are on the same line
Expand Down Expand Up @@ -44,4 +50,12 @@ const USER_STATUSES = [
'offline',
]
// 🚧 Currently this is an edge case and isn't fixed properly...
const WEEKDAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
const WEEKDAYS = [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
]