@pi-r/prettier 0.2.2 → 0.5.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/index.js +5 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function transform(context, value, options) {
|
|
3
|
+
async function transform(context, value, options) {
|
|
4
4
|
context = options.upgrade(context, __dirname);
|
|
5
5
|
const { sourceFile, filename } = options;
|
|
6
6
|
const baseConfig = options.toBaseConfig();
|
|
@@ -12,9 +12,10 @@ function transform(context, value, options) {
|
|
|
12
12
|
case 'json5':
|
|
13
13
|
case 'json-stringify':
|
|
14
14
|
for (const chunk of options.supplementChunks) {
|
|
15
|
-
const result = context.format(value, { ...baseConfig });
|
|
15
|
+
const result = await context.format(value, { ...baseConfig });
|
|
16
16
|
if (result) {
|
|
17
17
|
chunk.code = result;
|
|
18
|
+
chunk.sourceMap = undefined;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
break;
|
|
@@ -31,6 +32,7 @@ function transform(context, value, options) {
|
|
|
31
32
|
case 'mdx':
|
|
32
33
|
case 'typescript':
|
|
33
34
|
case 'yaml':
|
|
35
|
+
case 'acorn':
|
|
34
36
|
case 'espree':
|
|
35
37
|
case 'glimmer':
|
|
36
38
|
case 'meriyah':
|
|
@@ -41,6 +43,7 @@ function transform(context, value, options) {
|
|
|
41
43
|
}
|
|
42
44
|
break;
|
|
43
45
|
}
|
|
46
|
+
options.sourceMap.reset();
|
|
44
47
|
return context.format(value, baseConfig);
|
|
45
48
|
}
|
|
46
49
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/prettier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "prettier transform function for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"prettier": "^
|
|
23
|
+
"prettier": "^3.1.0"
|
|
24
24
|
}
|
|
25
25
|
}
|