Skip to content

Commit a3cd325

Browse files
author
Björn Büttner
committed
fix indentation level of generated tsx and jsx file
1 parent c0b9aaa commit a3cd325

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@idrinth/react-file-based-routes",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A simple file based routing library, that does not force itself on you.",
55
"type": "module",
66
"keywords": [

src/jsx-writer.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ export default class JsxWriter implements Writer {
88
// @ts-ignore TS6133
99
add(path: string, url: string, changed: string): void
1010
{
11-
this.items.push(' ' + `(() => {
12-
const LazyElement = lazy(() => import(
13-
\'./pages/${path}/index.tsx\',
14-
),);
15-
return {
16-
path: \'${url}\',
17-
exact: true,
18-
element: <Suspense fallback={<Loader/>}><LazyElement/></Suspense>,
19-
};
20-
})(),`);
11+
this.items.push(` (() => {
12+
const LazyElement = lazy(() => import(
13+
\'./pages/${path}/index.tsx\',
14+
),);
15+
return {
16+
path: \'${url}\',
17+
exact: true,
18+
element: <Suspense fallback={<Loader/>}><LazyElement/></Suspense>,
19+
};
20+
})(),`
21+
);
2122
}
2223
toString(): string {
2324
return 'import React, {\n' +

src/tsx-writer.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ export default class TsxWriter implements Writer {
88
// @ts-ignore TS6133
99
add(path: string, url: string, changed: string): void
1010
{
11-
this.items.push(' ' + `(() => {
12-
const LazyElement = lazy(() => import(
13-
\'./pages/${path}/index.tsx\',
14-
),);
15-
return {
16-
path: \'${url}\',
17-
exact: true,
18-
element: <Suspense fallback={<Loader/>}><LazyElement/></Suspense>,
19-
};
20-
})(),`);
11+
this.items.push(` (() => {
12+
const LazyElement = lazy(() => import(
13+
\'./pages/${path}/index.tsx\',
14+
),);
15+
return {
16+
path: \'${url}\',
17+
exact: true,
18+
element: <Suspense fallback={<Loader/>}><LazyElement/></Suspense>,
19+
};
20+
})(),`,
21+
);
2122
}
2223
toString(): string {
2324
return 'import React, {\n' +

0 commit comments

Comments
 (0)