Skip to content

Commit

Permalink
Fix eslint-plugin/no-meta-schema-default lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Dec 19, 2024
1 parent 719830b commit 84b16aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
27 changes: 6 additions & 21 deletions lib/rules/require-macro-variable-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,11 @@ module.exports = {
{
type: 'object',
properties: {
defineProps: {
type: 'string',
default: DEFAULT_OPTIONS.defineProps
},
defineEmits: {
type: 'string',
default: DEFAULT_OPTIONS.defineEmits
},
defineSlots: {
type: 'string',
default: DEFAULT_OPTIONS.defineSlots
},
useSlots: {
type: 'string',
default: DEFAULT_OPTIONS.useSlots
},
useAttrs: {
type: 'string',
default: DEFAULT_OPTIONS.useAttrs
}
defineProps: { type: 'string' },
defineEmits: { type: 'string' },
defineSlots: { type: 'string' },
useSlots: { type: 'string' },
useAttrs: { type: 'string' }
},
additionalProperties: false
}
Expand All @@ -60,7 +45,7 @@ module.exports = {
},
/** @param {RuleContext} context */
create(context) {
const options = context.options[0] || DEFAULT_OPTIONS
const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0])
const relevantMacros = new Set([
...Object.keys(DEFAULT_OPTIONS),
'withDefaults'
Expand Down
14 changes: 5 additions & 9 deletions lib/rules/sort-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ module.exports = {
type: 'object',
properties: {
caseSensitive: {
type: 'boolean',
default: true
type: 'boolean'
},
ignoreChildrenOf: {
type: 'array'
Expand All @@ -93,16 +92,13 @@ module.exports = {
},
minKeys: {
type: 'integer',
minimum: 2,
default: 2
minimum: 2
},
natural: {
type: 'boolean',
default: false
type: 'boolean'
},
runOutsideVue: {
type: 'boolean',
default: true
type: 'boolean'
}
},
additionalProperties: false
Expand Down Expand Up @@ -137,7 +133,7 @@ module.exports = {
(options && options.ignoreChildrenOf) || ['model']
)
const insensitive = options && options.caseSensitive === false
const minKeys = options && options.minKeys
const minKeys = options?.minKeys ?? 2
const natural = options && options.natural
const isValidOrder =
isValidOrders[order + (insensitive ? 'I' : '') + (natural ? 'N' : '')]
Expand Down

0 comments on commit 84b16aa

Please sign in to comment.