-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...m-components/valid/exceptions-input.astro → ...omponents/valid/exceptions-01-input.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
--- | ||
// This file is used to test the exceptions for the `no-exports-from-components` rule. | ||
// The following exports are allowed as exceptions. | ||
export const getStaticPath = () => { | ||
export const getStaticPath = (): { param: unknown }[] => { | ||
// logic here | ||
return [{ param: "value" }] | ||
} | ||
export const prerender = true; | ||
export const prerender = true | ||
--- | ||
|
||
<div>Hello World</div> |
4 changes: 3 additions & 1 deletion
4
tests/fixtures/rules/no-exports-from-components/valid/exceptions-02-input.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
--- | ||
// This file is used to test the exception for the `getStaticPath` function in the `no-exports-from-components` rule. | ||
export async function getStaticPath() { | ||
export async function getStaticPath(): Promise<{ param: unknown }[]> { | ||
// logic here | ||
return [] | ||
} | ||
--- | ||
|
||
<div>Hello World</div> |
13 changes: 13 additions & 0 deletions
13
tests/fixtures/rules/no-exports-from-components/valid/exceptions-03-input.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
// This file is used to test the exceptions for the `no-exports-from-components` rule. | ||
// The following exports are allowed as exceptions. | ||
const getStaticPath = (): { param: unknown }[] => { | ||
// logic here | ||
return [] | ||
} | ||
const prerender = true | ||
export { getStaticPath, prerender } | ||
--- | ||
|
||
<div>Hello World</div> |