Skip to content

Commit

Permalink
ci(lint): auto-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 22, 2024
1 parent ce14120 commit e6ba91e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/language-core/lib/codegen/template/elementProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function* generateElementProps(

if (
propName === undefined
|| options.vueCompilerOptions.dataAttributes.some(pattern => minimatch(propName!, pattern))
|| options.vueCompilerOptions.dataAttributes.some(pattern => minimatch(propName, pattern))
|| (propName === 'style' && ++styleAttrNum >= 2)
|| (propName === 'class' && ++classAttrNum >= 2)
|| (propName === 'name' && node.tagType === CompilerDOM.ElementTypes.SLOT) // #2308
Expand All @@ -82,7 +82,7 @@ export function* generateElementProps(
const shouldCamelize = canCamelize
&& (!prop.arg || (prop.arg.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic)) // isStatic
&& hyphenateAttr(propName) === propName
&& !options.vueCompilerOptions.htmlAttributes.some(pattern => minimatch(propName!, pattern));
&& !options.vueCompilerOptions.htmlAttributes.some(pattern => minimatch(propName, pattern));

const codes = wrapWith(
prop.loc.start.offset,
Expand Down
4 changes: 2 additions & 2 deletions packages/language-core/lib/plugins/file-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const plugin: VueLanguagePlugin = () => {
const attrs = match[2];
const lang = attrs.match(langReg)?.[2];
const content = match[3];
const contentStart = match.index! + matchText.indexOf(content);
const contentStart = match.index + matchText.indexOf(content);

if (tag === 'style') {
sfc.descriptor.styles.push({
Expand Down Expand Up @@ -70,7 +70,7 @@ const plugin: VueLanguagePlugin = () => {
};
}

templateContent = templateContent.substring(0, match.index) + ' '.repeat(matchText.length) + templateContent.substring(match.index! + matchText.length);
templateContent = templateContent.substring(0, match.index) + ' '.repeat(matchText.length) + templateContent.substring(match.index + matchText.length);
}

sfc.descriptor.template = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function create(
const inlayHints: vscode.InlayHint[] = [];

for (const pointer of document.getText(range).matchAll(twoslashReg)) {
const offset = pointer.index! + pointer[0].indexOf('^?') + document.offsetAt(range.start);
const offset = pointer.index + pointer[0].indexOf('^?') + document.offsetAt(range.start);
const position = document.positionAt(offset);
hoverOffsets.push([position, document.offsetAt({
line: position.line - 1,
Expand Down

0 comments on commit e6ba91e

Please sign in to comment.