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 Aug 24, 2024
1 parent cf29539 commit 653651a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions packages/component-meta/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ const worker = (checker: ComponentMetaChecker, withTsconfig: boolean) => describ
test('emits-generic', () => {
const componentPath = path.resolve(__dirname, '../../../test-workspace/component-meta/events/component-generic.vue');
const meta = checker.getComponentMeta(componentPath);
const foo = meta.events.find(event =>event.name === 'foo');
const foo = meta.events.find(event => event.name === 'foo');

expect(foo?.description).toBe('Emitted when foo...');
});
Expand All @@ -736,7 +736,7 @@ const worker = (checker: ComponentMetaChecker, withTsconfig: boolean) => describ
test.skip('emits-class', () => {
const componentPath = path.resolve(__dirname, '../../../test-workspace/component-meta/events/component-class.vue');
const meta = checker.getComponentMeta(componentPath);
const foo = meta.events.find(event =>event.name === 'foo');
const foo = meta.events.find(event => event.name === 'foo');

expect(foo?.description).toBe('Emitted when foo...');
});
Expand Down Expand Up @@ -858,7 +858,7 @@ const checkerOptions: MetaCheckerOptions = {
};
const tsconfigChecker = createChecker(
path.resolve(__dirname, '../../../test-workspace/component-meta/tsconfig.json'),
checkerOptions,
checkerOptions
);
const noTsConfigChecker = createCheckerByJson(
path.resolve(__dirname, '../../../test-workspace/component-meta'),
Expand All @@ -868,7 +868,7 @@ const noTsConfigChecker = createCheckerByJson(
"**/*",
],
},
checkerOptions,
checkerOptions
);

worker(tsconfigChecker, true);
Expand Down
6 changes: 3 additions & 3 deletions packages/language-service/tests/complete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ for (const dirName of testDirs) {
let complete = await tester.languageService.getCompletionItems(
uri,
position,
{ triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked },
{ triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked }
);

if (!complete.items.length) {
// fix #2511 test case, it's a bug of TS 5.3
complete = await tester.languageService.getCompletionItems(
uri,
position,
{ triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked },
{ triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked }
);
}

Expand Down Expand Up @@ -107,7 +107,7 @@ function findCompleteActions(text: string) {

return [...text.matchAll(/(\^*)complete:\s*([\S]*)/g)].map(flag => {

const offset = flag.index!;
const offset = flag.index;
const label = flag[2];

return {
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/tests/findDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (const dirName of testDirs) {

const locations = await tester.languageService.getDefinition(
uri,
position,
position
);

expect(locations).toBeDefined();
Expand Down Expand Up @@ -78,7 +78,7 @@ function findActions(text: string) {

return [...text.matchAll(definitionReg)].map(flag => {

const offset = flag.index!;
const offset = flag.index;
const targetFile = flag[2];
const targeRange = {
start: Number(flag[3]),
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/tests/inlayHint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for (const dirName of testDirs) {

const inlayHints = await tester.languageService.getInlayHints(
uri,
range,
range
);

const inlayHint = inlayHints?.find(inlayHint => inlayHint.label === action.label);
Expand Down Expand Up @@ -69,7 +69,7 @@ function findActions(text: string) {

return [...text.matchAll(inlayHintReg)].map(flag => {

const offset = flag.index!;
const offset = flag.index;
const label = flag[2];

return {
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/tests/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (const dirName of testDirs) {
const locations = await tester.languageService.getReferences(
uri,
position,
{ includeDeclaration: true },
{ includeDeclaration: true }
);

expect(locations).toBeDefined();
Expand Down Expand Up @@ -67,7 +67,7 @@ function findActions(text: string) {

return [...text.matchAll(referenceReg)].map(flag => {

const offset = flag.index!;
const offset = flag.index;
// The definition itself is also counted
const count = Number(flag[2]) + 1;

Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/tests/rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ for (const dirName of testDirs) {
const edit = await tester.languageService.getRenameEdits(
uri,
position,
action.newName,
action.newName
);

expect(edit).toBeDefined();
Expand Down Expand Up @@ -86,7 +86,7 @@ function findRenameActions(text: string) {

return [...text.matchAll(renameReg)].map(flag => {

const start = flag.index!;
const start = flag.index;
const end = start + flag[1].length;
const newName = flag[2];

Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/tests/utils/mockEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function createMockServiceEnv(
): LanguageServiceEnvironment {
return {
workspaceFolders: [rootUri],
async getConfiguration(section: string) {
getConfiguration(section: string) {
const settings = getSettings();
if (settings[section]) {
return settings[section];
Expand Down
8 changes: 4 additions & 4 deletions packages/tsc/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ function runVueTsc(cwd: string) {
{
silent: true,
cwd
},
}
);

cp.stdout?.setEncoding('utf8');
cp.stdout?.on('data', (data) => {
cp.stdout?.on('data', data => {
console.log(data);
});
cp.stderr?.setEncoding('utf8');
cp.stderr?.on('data', (data) => {
cp.stderr?.on('data', data => {
console.error(data);
});

cp.on('exit', (code) => {
cp.on('exit', code => {
if (code === 0) {
resolve(undefined);
} else {
Expand Down

0 comments on commit 653651a

Please # to comment.