From e0e1488b26105c0023d275d8f18f2dfbe151ca40 Mon Sep 17 00:00:00 2001 From: MJ Zhang <0618@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:34:22 -0700 Subject: [PATCH] chore: fix config export lint error (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: fix config export lint error * chore: cleanup draft code * chore: changeset --------- Co-authored-by: MJ☔ --- .changeset/warm-sloths-care.md | 5 +++++ .../src/client-config-writer/client_config_writer.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/warm-sloths-care.md diff --git a/.changeset/warm-sloths-care.md b/.changeset/warm-sloths-care.md new file mode 100644 index 0000000000..421b2a1614 --- /dev/null +++ b/.changeset/warm-sloths-care.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/client-config': patch +--- + +fix config export lint error diff --git a/packages/client-config/src/client-config-writer/client_config_writer.ts b/packages/client-config/src/client-config-writer/client_config_writer.ts index ac1e0aad74..cf7cfd4660 100644 --- a/packages/client-config/src/client-config-writer/client_config_writer.ts +++ b/packages/client-config/src/client-config-writer/client_config_writer.ts @@ -18,11 +18,12 @@ export class ClientConfigWriter { switch (fileExtension) { case '.ts': case '.js': { - const fileContent = `export default ${JSON.stringify( + const fileContent = `const amplifyConfig = ${JSON.stringify( clientConfig, null, 2 - )}${os.EOL}`; + )}${os.EOL}export default amplifyConfig;${os.EOL} + `; await fsp.writeFile(targetPath, fileContent); break; }