Skip to content

Commit 72a146d

Browse files
committed
chore(format): run format
1 parent 2237928 commit 72a146d

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

lib/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("TypeScriptLoader", () => {
2222
},
2323
});
2424
const loadedCfg = cfg.load(
25-
path.resolve(fixturesPath, "valid.fixture.ts")
25+
path.resolve(fixturesPath, "valid.fixture.ts"),
2626
);
2727

2828
expect(typeof loadedCfg!.config).toStrictEqual("object");
@@ -54,7 +54,7 @@ describe("TypeScriptLoader", () => {
5454
},
5555
});
5656
const loadedCfg = await cfg.load(
57-
path.resolve(fixturesPath, "valid.fixture.ts")
57+
path.resolve(fixturesPath, "valid.fixture.ts"),
5858
);
5959

6060
expect(typeof loadedCfg!.config).toStrictEqual("object");
@@ -87,7 +87,7 @@ describe("TypeScriptLoader", () => {
8787
},
8888
});
8989
const loadedCfg = cfg.load(
90-
path.resolve(fixturesPath, "valid.fixture.ts")
90+
path.resolve(fixturesPath, "valid.fixture.ts"),
9191
);
9292

9393
expect(typeof loadedCfg!.config).toStrictEqual("object");
@@ -103,7 +103,7 @@ describe("TypeScriptLoader", () => {
103103
});
104104

105105
expect(() =>
106-
cfg.load(path.resolve(fixturesPath, "invalid.fixture.ts"))
106+
cfg.load(path.resolve(fixturesPath, "invalid.fixture.ts")),
107107
).toThrowError();
108108
});
109109
});

lib/loader.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("TypeScriptLoader", () => {
5252
const filePath = path.resolve(fixturesPath, "invalid.fixture.ts");
5353
loader(filePath, readFixtureContent(filePath));
5454
fail(
55-
"Error should be thrown upon failing to transpile an invalid TS file."
55+
"Error should be thrown upon failing to transpile an invalid TS file.",
5656
);
5757
} catch (error: unknown) {
5858
expect(error).toBeInstanceOf(TypeScriptCompileError);
@@ -81,7 +81,7 @@ describe("TypeScriptLoader", () => {
8181
try {
8282
loader("filePath", "readFixtureContent(filePath)");
8383
fail(
84-
"Error should be thrown upon failing to transpile an invalid TS file."
84+
"Error should be thrown upon failing to transpile an invalid TS file.",
8585
);
8686
} catch (error: unknown) {
8787
expect(error).not.toBeInstanceOf(TypeScriptCompileError);

lib/typescript-compile-error.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ describe("TypeScriptCompileError", () => {
88
const tscError = TypeScriptCompileError.fromError(testError);
99

1010
expect(tscError.name).toStrictEqual(
11-
TypeScriptCompileError.prototype.constructor.name
11+
TypeScriptCompileError.prototype.constructor.name,
1212
);
1313
expect(tscError.message).toContain(
14-
"TypeScriptLoader failed to compile TypeScript"
14+
"TypeScriptLoader failed to compile TypeScript",
1515
);
1616
expect(tscError.message).toContain("Test Error");
1717
expect(tscError.stack).toBe(testError.stack);
@@ -23,7 +23,7 @@ describe("TypeScriptCompileError", () => {
2323
const tscError = TypeScriptCompileError.fromError(legacyError);
2424

2525
expect(tscError.message).toContain(
26-
"TypeScriptLoader failed to compile TypeScript:"
26+
"TypeScriptLoader failed to compile TypeScript:",
2727
);
2828
});
2929
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"build:sources": "node ./scripts/esbuild.config.mjs",
3636
"build:types": "tsc -p tsconfig.build.json",
3737
"check:types": "tsc -p tsconfig.json",
38+
"format": "npm run format:check -- --write",
3839
"format:check": "prettier --check \"{**/*,*}.{js,cjs,mjs,ts}\"",
39-
"format:write": "npm run format:check -- --write",
4040
"lint": "eslint --ext \".js,.cjs,.mjs,.ts\" .",
4141
"lint:fix": "npm run lint -- --fix",
4242
"release": "release-it",

scripts/esbuild.config.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ async function getSourceEntryPoints() {
7777
const startTime = Date.now();
7878
console.info(
7979
chalk.bold(
80-
`🚀 ${chalk.blueBright("cosmiconfig-typescript-loader")} Build\n`
81-
)
80+
`🚀 ${chalk.blueBright("cosmiconfig-typescript-loader")} Build\n`,
81+
),
8282
);
8383

8484
console.info("- Generate sources");
@@ -91,27 +91,27 @@ async function getSourceEntryPoints() {
9191
const result = await buildSources(sourceEntryPoints, format);
9292
const analysis = await analyzeMetafile(
9393
// @ts-ignore we know that the metafile will be emitted
94-
result.metafile
94+
result.metafile,
9595
);
9696
console.info(
9797
`${analysis
9898
.trim()
9999
.split(/\n\r/)
100100
.map((line) => ` ${line}`)
101-
.join()}`
101+
.join()}`,
102102
);
103103

104104
console.info(
105105
`${chalk.bold.greenBright("✔")} Generating ${chalk.bold.greenBright(
106-
format
107-
)} sources completed!\n`
106+
format,
107+
)} sources completed!\n`,
108108
);
109109
}
110110

111111
console.info(
112112
chalk.bold.green(
113-
`✔ Generate sources completed! (${Date.now() - startTime}ms)`
114-
)
113+
`✔ Generate sources completed! (${Date.now() - startTime}ms)`,
114+
),
115115
);
116116
} catch (error) {
117117
console.error(`🧨 ${chalk.red.bold("Failed:")} ${error.message}`);

0 commit comments

Comments
 (0)