Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Oct 30, 2024
1 parent d2540d5 commit a21eab3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions extensions/vscode/src/compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ const extensions = useAllExtensions();

export const incompatibleExtensions = computed(() => {
return extensions.value
.filter((ext) => isExtensionCompatibleWithHybridMode(ext) === false)
.map((ext) => ext.id);
.filter(ext => isExtensionCompatibleWithHybridMode(ext) === false)
.map(ext => ext.id);
});

export const unknownExtensions = computed(() => {
return extensions.value
.filter((ext) => isExtensionCompatibleWithHybridMode(ext) === undefined && !!ext.packageJSON?.contributes?.typescriptServerPlugins)
.map((ext) => ext.id);
.filter(ext => isExtensionCompatibleWithHybridMode(ext) === undefined && !!ext.packageJSON?.contributes?.typescriptServerPlugins)
.map(ext => ext.id);
});

function isExtensionCompatibleWithHybridMode(extension: vscode.Extension<any>) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/src/features/splitEditors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function activate(client: BaseLanguageClient) {

const activeTextEditor = useActiveTextEditor();
const getDocDescriptor = useDocDescriptor(client);

useCommand('vue.action.splitEditors', async () => {
const editor = activeTextEditor.value;
if (!editor) {
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/src/hybridMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function useHybridModeTips() {
"Open Settings",
"Report a false positive"
)
.then((value) => {
.then(value => {
if (value === "Open Settings") {
executeCommand(
"workbench.action.openSettings",
Expand Down Expand Up @@ -99,7 +99,7 @@ export function useHybridModeTips() {
msg += `).`;
vscode.window
.showInformationMessage(msg, "Open Settings")
.then((value) => {
.then(value => {
if (value === "Open Settings") {
executeCommand(
"workbench.action.openSettings",
Expand All @@ -126,7 +126,7 @@ export function useHybridModeTips() {
"Open Settings",
"Report a false positive"
)
.then((value) => {
.then(value => {
if (value === "Open Settings") {
executeCommand(
"workbench.action.openSettings",
Expand Down
8 changes: 4 additions & 4 deletions extensions/vscode/src/insiders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useInsidersStatusItem(context: vscode.ExtensionContext) {
succeed = true;
break;
}
catch {};
catch { };
}

item.busy = false;
Expand Down Expand Up @@ -49,7 +49,7 @@ export function useInsidersStatusItem(context: vscode.ExtensionContext) {
};
if (
json.versions.some(
(version) => version.version === context.extension.packageJSON.version
version => version.version === context.extension.packageJSON.version
)
) {
item.text = "🚀 Insiders Edition";
Expand All @@ -60,7 +60,7 @@ export function useInsidersStatusItem(context: vscode.ExtensionContext) {
item.severity = vscode.LanguageStatusSeverity.Warning;
vscode.window
.showInformationMessage("New Insiders Version Available!", "Download")
.then((download) => {
.then(download => {
if (download) {
executeCommand("vue-insiders.update");
}
Expand Down Expand Up @@ -114,7 +114,7 @@ export function useInsidersStatusItem(context: vscode.ExtensionContext) {
);
} else {
const downloads = json.versions.find(
(v) => v.version === version
v => v.version === version
)?.downloads;
if (downloads) {
const quickPickItems: { [key: string]: vscode.QuickPickItem; } = {
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/languageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function activate(
useHybridModeTips();

const { stop } = watch(activeTextEditor, () => {
if (visibleTextEditors.value.some((editor) => config.server.includeLanguages.includes(editor.document.languageId))) {
if (visibleTextEditors.value.some(editor => config.server.includeLanguages.includes(editor.document.languageId))) {
activateLc(context, createLc);
nextTick(() => {
stop();
Expand Down Expand Up @@ -117,7 +117,7 @@ async function activateLc(

if (!enabledHybridMode.value) {
lsp.activateTsConfigStatusItem(selectors, 'vue.tsconfig', client);
lsp.activateTsVersionStatusItem(selectors, 'vue.tsversion', context, (text) => 'TS ' + text);
lsp.activateTsVersionStatusItem(selectors, 'vue.tsversion', context, text => 'TS ' + text);
lsp.activateFindFileReferences('vue.findAllFileReferences', client);
}

Expand Down
16 changes: 8 additions & 8 deletions extensions/vscode/src/nodeClientMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const { activate, deactivate } = defineExtension(async () => {
vscode.window.showWarningMessage(
'Takeover mode is no longer needed since v2. Please enable the "TypeScript and JavaScript Language Features" extension.',
'Show Extension'
).then((selected) => {
).then(selected => {
if (selected) {
executeCommand('workbench.extensions.search', '@builtin typescript-language-features');
}
Expand All @@ -33,7 +33,7 @@ export const { activate, deactivate } = defineExtension(async () => {
vscode.window.showWarningMessage(
`The "${vueTsPluginExtension.packageJSON.displayName}" extension is no longer needed since v2. Please uninstall it.`,
'Show Extension'
).then((selected) => {
).then(selected => {
if (selected) {
executeCommand('workbench.extensions.search', vueTsPluginExtension.id);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ try {
if (!enabledTypeScriptPlugin.value) {
text = text.replace(
'for(const e of n.contributes.typescriptServerPlugins',
(s) => s + `.filter(p=>p.name!=='typescript-vue-plugin-bundle')`
s => s + `.filter(p=>p.name!=='typescript-vue-plugin-bundle')`
);
} else if (enabledHybridMode.value) {
// patch readPlugins
Expand All @@ -159,7 +159,7 @@ try {
[
'languages:',
`e.name==='typescript-vue-plugin-bundle'?[${config.server.includeLanguages
.map((lang) => `'${lang}'`)
.map(lang => `'${lang}'`)
.join(',')}]`,
':Array.isArray(e.languages)'
].join('')
Expand All @@ -168,21 +168,21 @@ try {
// VSCode < 1.87.0
text = text.replace(
't.$u=[t.$r,t.$s,t.$p,t.$q]',
(s) => s + '.concat("vue")'
s => s + '.concat("vue")'
); // patch jsTsLanguageModes
text = text.replace(
'.languages.match([t.$p,t.$q,t.$r,t.$s]',
(s) => s + '.concat("vue")'
s => s + '.concat("vue")'
); // patch isSupportedLanguageMode

// VSCode >= 1.87.0
text = text.replace(
't.jsTsLanguageModes=[t.javascript,t.javascriptreact,t.typescript,t.typescriptreact]',
(s) => s + '.concat("vue")'
s => s + '.concat("vue")'
); // patch jsTsLanguageModes
text = text.replace(
'.languages.match([t.typescript,t.typescriptreact,t.javascript,t.javascriptreact]',
(s) => s + '.concat("vue")'
s => s + '.concat("vue")'
); // patch isSupportedLanguageMode
}

Expand Down

0 comments on commit a21eab3

Please sign in to comment.