Skip to content

Commit 3a15bc6

Browse files
committed
Remove unnecessary estree plugin and improve data fetching
1 parent 2fc1eaa commit 3a15bc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/js/ra-doc-exec.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
import { transpileModule } from 'https://esm.sh/typescript@5.7.3';
33
import * as prettier from 'https://esm.sh/prettier@3.5.1/standalone';
44
import * as babel from 'https://esm.sh/prettier@3.5.1/plugins/babel';
5-
import * as estree from 'https://esm.sh/prettier@3.5.1/plugins/estree';
65
import { marked } from 'https://esm.sh/marked@15.0.7';
76

87
export const showTip = async () => {
98
const tipContainer = document.getElementById('tip-container');
109
const tipElement = document.getElementById('tip');
1110
if (!tipElement) return;
1211

13-
const tips = await getContents('/assets/tips.md');
14-
const features = await getContents('/assets/features.md');
12+
const [tips, features] = await Promise.all([
13+
getContents('/assets/tips.md'),
14+
getContents('/assets/features.md'),
15+
]);
1516
const all = tips.concat(features);
1617

1718
const content = all[Math.floor(Math.random() * all.length)]
@@ -117,7 +118,7 @@ const transpileToJS = async tsCode => {
117118
'\n\n'
118119
),
119120
{
120-
plugins: [babel, estree],
121+
plugins: [babel],
121122
parser: 'babel',
122123
tabWidth: 4,
123124
printWidth: 120,

0 commit comments

Comments
 (0)