Skip to content

Commit

Permalink
lint: update tsslint and import config by URL
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jun 8, 2024
1 parent 5c65f10 commit 07ac88a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 36 deletions.
2 changes: 1 addition & 1 deletion extensions/vscode/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CreateLanguageClient = (
outputChannel: vscode.OutputChannel,
) => lsp.BaseLanguageClient;

export async function activate(context: vscode.ExtensionContext, createLc: CreateLanguageClient) {
export function activate(context: vscode.ExtensionContext, createLc: CreateLanguageClient) {

const stopCheck = vscode.window.onDidChangeActiveTextEditor(tryActivate);
tryActivate();
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@tsslint/cli": "latest",
"@tsslint/config": "latest",
"@volar/language-service": "~2.3.0-alpha.15",
"@volar/tsslint-config": "latest",
"typescript": "latest",
"vite": "latest",
"vitest": "latest"
Expand Down
4 changes: 2 additions & 2 deletions packages/language-server/lib/hybridModeProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function createHybridModeProject(
...sys,
version: 0,
async sync() {
return 0;
return await 0;
},
dispose() { },
},
Expand All @@ -72,7 +72,7 @@ export function createHybridModeProject(
return await simpleLs;
}
},
async getExistingLanguageServices() {
getExistingLanguageServices() {
return Promise.all([
...tsconfigProjects.values(),
simpleLs,
Expand Down
6 changes: 3 additions & 3 deletions packages/language-service/lib/ideFeatures/nameCasing.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { LanguageServiceContext, VirtualCode } from '@volar/language-service';
import type { LanguageServiceContext, ProviderResult, VirtualCode } from '@volar/language-service';
import type { CompilerDOM } from '@vue/language-core';
import * as vue from '@vue/language-core';
import { VueVirtualCode, hyphenateAttr, hyphenateTag } from '@vue/language-core';
import { computed } from 'computeds';
import type * as vscode from 'vscode-languageserver-protocol';
import { AttrNameCasing, TagNameCasing } from '../types';
import type { URI } from 'vscode-uri';
import { AttrNameCasing, TagNameCasing } from '../types';

export async function convertTagName(
context: LanguageServiceContext,
Expand Down Expand Up @@ -170,7 +170,7 @@ export async function detect(

return result;
}
async function getTagNameCase(file: VueVirtualCode): Promise<TagNameCasing[]> {
function getTagNameCase(file: VueVirtualCode): ProviderResult<TagNameCasing[]> {

const result = new Set<TagNameCasing>();

Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-extract-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function create(
create(context) {
const tsPluginClient = getTsPluginClient?.(context);
return {
async provideCodeActions(document, range, _context) {
provideCodeActions(document, range, _context) {

const startOffset = document.offsetAt(range.start);
const endOffset = document.offsetAt(range.end);
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export function create(
};
}

async function afterHtmlCompletion(completionList: vscode.CompletionList, sourceDocument: TextDocument) {
function afterHtmlCompletion(completionList: vscode.CompletionList, sourceDocument: TextDocument) {

const replacement = getReplacement(completionList, sourceDocument);

Expand Down
38 changes: 13 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tsslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { defineConfig } from '@tsslint/config';
import VolarLintConfig from '@volar/tsslint-config';

export default defineConfig({
...VolarLintConfig,
...(await import('https://raw.githubusercontent.com/volarjs/volar.js/master/tsslint.config.ts')).default,
plugins: [
({ tsconfig }) => ({
resolveRules(rules) {
Expand Down

0 comments on commit 07ac88a

Please sign in to comment.