Skip to content

Commit

Permalink
feat: to parse using project: true instead if projectService is s…
Browse files Browse the repository at this point in the history
…pecified (#348)

* feat: to parse using `project: true` instead if `projectService` is specified

* Create thin-humans-lay.md

* fix
  • Loading branch information
ota-meshi authored Nov 12, 2024
1 parent 2d45e8a commit 3ba8379
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-humans-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro-eslint-parser": minor
---

feat: to parse using `project: true` instead if `projectService` is specified
2 changes: 1 addition & 1 deletion explorer-v3/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function isActive(path) {
baseUrl: {JSON.stringify(baseUrl)}
</div>
<><SnsBar client:only="svelte" /></>
<a href="https://github.com/ota-meshi/astro-eslint-parser" class="github-link"
<a class="github-link" href="https://github.com/ota-meshi/astro-eslint-parser"
>View on GitHub
</a>
</header>
Expand Down
6 changes: 3 additions & 3 deletions explorer-v3/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const { title } = Astro.props as Props;
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta content="width=device-width" name="viewport" />
<link href="/favicon.ico" rel="icon" type="image/x-icon" />
<title>{title}</title>
<meta name="description" content="Astro component parser for ESLint" />
<meta content="Astro component parser for ESLint" name="description" />
</head>
<body>
<Header />
Expand Down
13 changes: 13 additions & 0 deletions src/parser/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,20 @@ function parseScriptInternal(
parserOptions.project
) {
patchResult = tsPatch(parserOptions, parserOptionsCtx.getTSParserName()!);
} else if (
parserOptionsCtx.isTypeScript() &&
parserOptions.filePath &&
parserOptions.projectService
) {
console.warn(

Check warning on line 106 in src/parser/script.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
"`astro-eslint-parser` does not support the `projectService` option, it will parse it as `project: true` instead.",
);
patchResult = tsPatch(
{ ...parserOptions, project: true },
parserOptionsCtx.getTSParserName()!,
);
}

const result = isEnhancedParserObject(parser)
? patchResult?.parse
? patchResult.parse(code, parser)
Expand Down

0 comments on commit 3ba8379

Please sign in to comment.