eslint-plugin-vuetify
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
'use strict'; | ||
/** @type {Map<RegExp, (args: string[]) => string> | Map<string, string>} */ | ||
/** @type {Map<RegExp, ((args: string[]) => string | false) | false> | Map<string, string | false>} */ | ||
const replacements = new Map([[/^rounded-(r|l|tr|tl|br|bl)(-.*)?$/, ([side, rest]) => { | ||
@@ -20,3 +20,3 @@ side = { | ||
return `border-${side}${rest}`; | ||
}], [/^text-xs-(left|right|center|justify)$/, ([align]) => `text-${align}`], ['scroll-y', 'overflow-y-auto'], ['hide-overflow', 'overflow-hidden'], ['show-overflow', 'overflow-visible'], ['no-wrap', 'text-no-wrap'], ['ellipsis', 'text-truncate'], ['left', 'float-left'], ['right', 'float-right'], ['display-4', 'text-h1'], ['display-3', 'text-h2'], ['display-2', 'text-h3'], ['display-1', 'text-h4'], ['headline', 'text-h5'], ['title', 'text-h6'], ['subtitle-1', 'text-subtitle-1'], ['subtitle-2', 'text-subtitle-2'], ['body-1', 'text-body-1'], ['body-2', 'text-body-2'], ['caption', 'text-caption'], ['caption', 'text-caption'], ['overline', 'text-overline']]); | ||
}], [/^text-xs-(left|right|center|justify)$/, ([align]) => `text-${align}`], ['scroll-y', 'overflow-y-auto'], ['hide-overflow', 'overflow-hidden'], ['show-overflow', 'overflow-visible'], ['no-wrap', 'text-no-wrap'], ['ellipsis', 'text-truncate'], ['left', 'float-left'], ['right', 'float-right'], ['display-4', 'text-h1'], ['display-3', 'text-h2'], ['display-2', 'text-h3'], ['display-1', 'text-h4'], ['headline', 'text-h5'], ['title', 'text-h6'], ['subtitle-1', 'text-subtitle-1'], ['subtitle-2', 'text-subtitle-2'], ['body-1', 'text-body-1'], ['body-2', 'text-body-2'], ['caption', 'text-caption'], ['caption', 'text-caption'], ['overline', 'text-overline'], [/^transition-(fast-out-slow-in|linear-out-slow-in|fast-out-linear-in|ease-in-out|fast-in-fast-out|swing)$/, false]]); | ||
@@ -54,4 +54,8 @@ // ------------------------------------------------------------------------------ | ||
const replace = replacer[1]; | ||
if (matches.length && typeof replace === 'function') { | ||
return changed.push([className, replace(matches)]); | ||
if (matches.length) { | ||
if (typeof replace === 'function') { | ||
return changed.push([className, replace(matches)]); | ||
} else { | ||
return changed.push([className, replace]); | ||
} | ||
} | ||
@@ -68,13 +72,23 @@ } | ||
}; | ||
context.report({ | ||
loc, | ||
messageId: 'replacedWith', | ||
data: { | ||
a: change[0], | ||
b: change[1] | ||
}, | ||
fix(fixer) { | ||
return fixer.replaceTextRange(range, change[1]); | ||
} | ||
}); | ||
if (change[1]) { | ||
context.report({ | ||
loc, | ||
messageId: 'replacedWith', | ||
data: { | ||
a: change[0], | ||
b: change[1] | ||
}, | ||
fix(fixer) { | ||
return fixer.replaceTextRange(range, change[1]); | ||
} | ||
}); | ||
} else { | ||
context.report({ | ||
loc, | ||
messageId: 'removed', | ||
data: { | ||
name: change[0] | ||
} | ||
}); | ||
} | ||
}); | ||
@@ -81,0 +95,0 @@ } |
@@ -30,2 +30,5 @@ 'use strict'; | ||
VListItemGroup: false, | ||
VListItemAvatar: false, | ||
VListItemContent: false, | ||
VListItemIcon: false, | ||
VOtpInput: false, | ||
@@ -39,2 +42,6 @@ VOverflowBtn: false, | ||
VStepper: false, | ||
VSubheader: { | ||
custom: 'v-list-subheader or class="text-subheader-2"' | ||
}, | ||
VSimpleTable: 'v-table', | ||
VTimePicker: false, | ||
@@ -41,0 +48,0 @@ VTreeview: false, |
@@ -151,2 +151,6 @@ 'use strict'; | ||
}, | ||
dense: { | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
outline: { | ||
@@ -278,3 +282,4 @@ name: 'variant', | ||
dense: { | ||
custom: 'density' | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
@@ -341,2 +346,3 @@ shaped: false, | ||
backgroundColor: false, | ||
dense: false, | ||
errorCount: 'max-errors', | ||
@@ -494,6 +500,4 @@ hideSpinButtons: false, | ||
contentClass: false, | ||
height: false, | ||
position: false, | ||
...theme, | ||
...size | ||
...theme | ||
}, | ||
@@ -512,2 +516,6 @@ VItemGroup: { | ||
VList: { | ||
dense: { | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
expand: false, | ||
@@ -538,2 +546,6 @@ flat: false, | ||
append: false, | ||
dense: { | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
ripple: false, | ||
@@ -598,3 +610,2 @@ selectable: { | ||
VProgressLinear: { | ||
absolute: false, | ||
backgroundColor: 'bg-color', | ||
@@ -658,2 +669,6 @@ backgroundOpacity: 'bg-opacity', | ||
closeDelay: false, | ||
dense: { | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
halfIcon: false, | ||
@@ -687,3 +702,6 @@ iconLabel: 'item-aria-label', | ||
}, | ||
elevation: false, | ||
elevation: { | ||
name: 'content-class', | ||
value: value => `elevation-${value}` | ||
}, | ||
left: { | ||
@@ -712,2 +730,3 @@ name: 'location', | ||
...inputs, | ||
inputValue: 'model-value', | ||
value: undefined | ||
@@ -743,2 +762,6 @@ }, | ||
}, | ||
dense: { | ||
name: 'density', | ||
value: 'compact' | ||
}, | ||
reverse: false | ||
@@ -870,4 +893,5 @@ }, | ||
} else if (typeof replace === 'object' && 'name' in replace && 'value' in replace) { | ||
const value = typeof replace.value === 'function' ? replace.value(attr.directive ? context.getSourceCode().getText(attr.value.expression) : attr.value?.value) : replace.value; | ||
if (value == null) return; | ||
const oldValue = attr.directive ? context.getSourceCode().getText(attr.value.expression) : attr.value?.value; | ||
const value = typeof replace.value === 'function' ? replace.value(oldValue) : replace.value; | ||
if (value == null || value === oldValue) return; | ||
context.report({ | ||
@@ -874,0 +898,0 @@ messageId: 'replacedWith', |
{ | ||
"name": "eslint-plugin-vuetify", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"description": "An eslint plugin for Vuetify", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45942
1607