@ecopages/codemod 0.0.0-stage → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/package.json +63 -3
- package/src/cli.d.ts +18 -0
- package/src/cli.js +62 -0
- package/src/transforms/migrate-core-entrypoints.d.ts +3 -0
- package/src/transforms/migrate-core-entrypoints.js +303 -0
- package/src/transforms/migrate-data-hooks.d.ts +36 -0
- package/src/transforms/migrate-data-hooks.js +477 -0
- package/src/transforms/migrate-to-eco-component.d.ts +18 -0
- package/src/transforms/migrate-to-eco-component.js +224 -0
- package/src/transforms/migrate-to-eco-page.d.ts +23 -0
- package/src/transforms/migrate-to-eco-page.js +444 -0
- package/src/transforms/print-options.d.ts +13 -0
- package/src/transforms/print-options.js +15 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recast print options shared by the transforms.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Recast ends reprinted lines with the host's line ending unless told otherwise, so on Windows a rewritten
|
|
6
|
+
* import in an LF file would end in CRLF. The source's own line ending is kept instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function printOptions(source: string): {
|
|
9
|
+
readonly quote: "single";
|
|
10
|
+
readonly tabWidth: 2;
|
|
11
|
+
readonly useTabs: true;
|
|
12
|
+
readonly lineTerminator: "\n" | "\r\n";
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recast print options shared by the transforms.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Recast ends reprinted lines with the host's line ending unless told otherwise, so on Windows a rewritten
|
|
6
|
+
* import in an LF file would end in CRLF. The source's own line ending is kept instead.
|
|
7
|
+
*/
|
|
8
|
+
export function printOptions(source) {
|
|
9
|
+
return {
|
|
10
|
+
quote: 'single',
|
|
11
|
+
tabWidth: 2,
|
|
12
|
+
useTabs: true,
|
|
13
|
+
lineTerminator: source.includes('\r\n') ? '\r\n' : '\n',
|
|
14
|
+
};
|
|
15
|
+
}
|