Skip to content

Commit

Permalink
add projectService: undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 29, 2025
1 parent 78db8a8 commit 6353982
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/common/parser-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ParserOptions {
lib?: string[]

project?: string | string[]
projectService?: boolean | ProjectServiceOptions
projectFolderIgnoreList?: string[]
tsconfigRootDir?: string
extraFileExtensions?: string[]
Expand All @@ -55,6 +56,13 @@ export interface ParserOptions {
>
}

interface ProjectServiceOptions {
allowDefaultProject?: string[]
defaultProject?: string
loadTypeScriptPlugins?: boolean
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number
}

export function isSFCFile(parserOptions: ParserOptions) {
if (parserOptions.filePath === "<input>") {
return true
Expand Down
1 change: 1 addition & 0 deletions src/html/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export class Parser {
},
),
project: undefined,
projectService: undefined,
}
const scriptParserOptions = {
...this.baseParserOptions,
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function parseAsSFC(code: string, options: ParserOptions) {
yield getParserLangFromSFC(rootAST)
}),
project: undefined,
projectService: undefined,
})
}
result.ast.templateBody = templateBody
Expand Down
2 changes: 1 addition & 1 deletion src/script-setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ function getScriptSetupCodeBlocks(

const { ast, visitorKeys } = parseScript(
scriptCode,
{ ...parserOptions, project: undefined },
{ ...parserOptions, project: undefined, projectService: undefined },
offsetLocationCalculator,
)

Expand Down
2 changes: 1 addition & 1 deletion src/script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ export function parseGenericExpression(
const result = parseScriptFragmentWithOption(
scriptLet,
locationCalculator.getSubCalculatorShift(-14),
{ ...parserOptions, project: undefined },
{ ...parserOptions, project: undefined, projectService: undefined },
{
preFixLocationProcess(preResult) {
const params = getParams(preResult)
Expand Down

0 comments on commit 6353982

Please sign in to comment.