-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Description
When I use query or slug in kebab case, the generated file has a syntax error, and I want to solve this problem by enclosing the description in quotation marks.
翻訳処理前の日本語
kebab case での query や slug を使用すると生成されるファイルが syntax error となるので、記述をクォーテーションなどで囲うことで解決したい。src/pages/
└── test
├── [test-id]
│ └── index.js
└── index.jsinstall -Dv /dev/null src/pages/test/index.js
install -Dv /dev/null src/pages/test/[test-id]/index.js
node bin/index.jscurrent output
export const pagesPath = {
"test": {
_test-id: (test-id: string | number) => ({
$url: (url?: { hash?: string }) => ({ pathname: '/test/[test-id]' as const, query: { test-id }, hash: url?.hash })
}),
$url: (url?: { hash?: string }) => ({ pathname: '/test' as const, hash: url?.hash })
}
}
export type PagesPath = typeof pagesPathmodified output
export const pagesPath = {
"test": {
"_test-id": (test_id: string | number) => ({
$url: (url?: { hash?: string }) => ({ pathname: '/test/[test-id]' as const, query: { 'test-id': test_id }, hash: url?.hash })
}),
・・・Describe the solution you'd like
- properties are not renamed by enclosing it in quotation marks
- variable are set to snake case
Additional context
pull request for the forked repository
Metadata
Metadata
Assignees
Labels
No labels
