8000 feat: support nested plugins by so1ve · Pull Request #3528 · vuejs/language-tools · GitHub
[go: up one dir, main page]

Skip to content

feat: support nested plugins #3528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
8000
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ts.ts
  • Loading branch information
so1ve authored Sep 2, 2023
commit 41fd9daebfb121f3db11bf70427ad749a3aee43a
6 changes: 3 additions & 3 deletions packages/vue-language-core/src/utils/ts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as ts from 'typescript/lib/tsserverlibrary';
import * as path from 'path';
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from '../types';
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePluginOption } from '../types';

export type ParsedCommandLine = ts.ParsedCommandLine & {
vueOptions: Partial<VueCompilerOptions>;
Expand Down Expand Up @@ -158,7 +158,7 @@ function getPartialVueCompilerOptions(
}
if (rawOptions.plugins) {
const plugins = rawOptions.plugins
.map<VueLanguagePlugin[] | VueLanguagePlugin | undefined>((pluginPath: string) => {
.map<VueLanguagePluginOption>((pluginPath: string) => {
try {
const resolvedPath = resolvePath(pluginPath);
if (resolvedPath) {
Expand All @@ -169,7 +169,7 @@ function getPartialVueCompilerOptions(
console.warn('Load plugin failed', pluginPath, error);
}
})
.flat()
.flat(Infinity)
.filter((plugin): plugin is NonNullable<typeof plugin> => !!plugin);

result.plugins = plugins;
Expand Down
0