Skip to content

Commit 5af312b

Browse files
committed
chore: increase prettier print width to 100
1 parent 5f1df79 commit 5af312b

File tree

94 files changed

+159
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+159
-630
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"useTabs": true
2+
"useTabs": true,
3+
"printWidth": 100
34
}

src/ambient-modules-declarations.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import dedent from "ts-dedent";
2-
import {
3-
ModuleKind,
4-
ModuleResolutionKind,
5-
Project,
6-
ScriptTarget,
7-
} from "ts-morph";
2+
import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph";
83
import { expect, test } from "vitest";
94
import { ambientModulesDeclarations } from "./ambient-modules-declarations";
105

@@ -63,9 +58,7 @@ test("ambient module from another package", () => {
6358
declare module "foo";
6459
`,
6560
);
66-
expect(ambientModulesDeclarations("", project, "my-package")).toStrictEqual(
67-
[],
68-
);
61+
expect(ambientModulesDeclarations("", project, "my-package")).toStrictEqual([]);
6962
});
7063

7164
test("shorthand ambient module", () => {

src/apparent-type.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import dedent from "ts-dedent";
2-
import {
3-
ModuleKind,
4-
ModuleResolutionKind,
5-
Project,
6-
ScriptTarget,
7-
} from "ts-morph";
2+
import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph";
83
import { expect, test } from "vitest";
94
import { apparentType } from "./apparent-type";
105

@@ -24,7 +19,5 @@ test("apparent type", () => {
2419
const foo = 42;
2520
`,
2621
);
27-
expect(apparentType(indexFile.getVariableDeclarationOrThrow("foo"))).toBe(
28-
"number",
29-
);
22+
expect(apparentType(indexFile.getVariableDeclarationOrThrow("foo"))).toBe("number");
3023
});

src/apparent-type.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export const apparentType = (node: Node): string =>
99
.getApparentType()
1010
.getText(
1111
node,
12-
ts.TypeFormatFlags.NoTruncation |
13-
TypeFormatFlags.UseAliasDefinedOutsideCurrentScope,
12+
ts.TypeFormatFlags.NoTruncation | TypeFormatFlags.UseAliasDefinedOutsideCurrentScope,
1413
)
1514
.replace(/^Number$/, "number")
1615
.replace(/^Boolean$/, "boolean")

src/create-project.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { temporaryDirectoryTask } from "tempy";
55
import { expect, test } from "vitest";
66
import { createProject, type CreateProjectOptions } from "./create-project";
77

8-
const _createProject = (options: CreateProjectOptions) =>
9-
Effect.runPromise(createProject(options));
8+
const _createProject = (options: CreateProjectOptions) => Effect.runPromise(createProject(options));
109

1110
test("no cwd", async () => {
1211
await temporaryDirectoryTask(async (dir) => {
@@ -35,9 +34,7 @@ test("with index file", async () => {
3534
const indexFilePath = join(dir, "./index.ts");
3635
await fs.writeFile(indexFilePath, "export {};");
3736
const { project } = await _createProject({ indexFilePath, cwd: dir });
38-
expect(
39-
project.getSourceFiles().map((sf) => sf.getBaseName()),
40-
).toStrictEqual(["index.ts"]);
37+
expect(project.getSourceFiles().map((sf) => sf.getBaseName())).toStrictEqual(["index.ts"]);
4138
});
4239
});
4340

@@ -48,8 +45,9 @@ test("with index file and other file", async () => {
4845
await fs.writeFile(indexFilePath, "export * from './other';");
4946
await fs.writeFile(otherFilePath, "export const a = 1;");
5047
const { project } = await _createProject({ indexFilePath, cwd: dir });
51-
expect(
52-
project.getSourceFiles().map((sf) => sf.getBaseName()),
53-
).toStrictEqual(["index.ts", "other.ts"]);
48+
expect(project.getSourceFiles().map((sf) => sf.getBaseName())).toStrictEqual([
49+
"index.ts",
50+
"other.ts",
51+
]);
5452
});
5553
});

src/create-project.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { Data, Effect } from "effect";
2-
import {
3-
ModuleKind,
4-
ModuleResolutionKind,
5-
Project,
6-
ScriptTarget,
7-
} from "ts-morph";
2+
import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph";
83

94
export type CreateProjectOptions = {
105
indexFilePath: string;

src/docs.test.ts

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import dedent from "ts-dedent";
2-
import {
3-
ModuleKind,
4-
ModuleResolutionKind,
5-
Project,
6-
ScriptTarget,
7-
} from "ts-morph";
2+
import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph";
83
import { expect, test } from "vitest";
94
import { docs } from "./docs";
105

@@ -56,36 +51,26 @@ test("docs", () => {
5651
export type Qux = {};
5752
`,
5853
);
59-
expect(docs(indexFile.getVariableDeclarationOrThrow("foo"))).toStrictEqual(
60-
[],
61-
);
54+
expect(docs(indexFile.getVariableDeclarationOrThrow("foo"))).toStrictEqual([]);
6255
expect(docs(indexFile.getVariableDeclarationOrThrow("bar"))).toStrictEqual([
6356
"/** Docs for bar */",
6457
]);
65-
expect(
66-
docs(indexFile.getExportedDeclarations().get("default")?.at(0)!),
67-
).toStrictEqual(["/** Docs for expression */"]);
58+
expect(docs(indexFile.getExportedDeclarations().get("default")?.at(0)!)).toStrictEqual([
59+
"/** Docs for expression */",
60+
]);
6861
expect(docs(indexFile.getFunctionOrThrow("fooFunc"))).toStrictEqual([
6962
"/** Docs for function overloads 1 */",
7063
"/** Docs for function overloads 2 */",
7164
]);
72-
expect(
73-
docs(indexFile.getClassOrThrow("FooClass").getMethodOrThrow("fooMethod")),
74-
).toStrictEqual([
65+
expect(docs(indexFile.getClassOrThrow("FooClass").getMethodOrThrow("fooMethod"))).toStrictEqual([
7566
"/** Docs for class method overloads 1 */",
7667
"/** Docs for class method overloads 2 */",
7768
]);
7869
expect(
79-
docs(
80-
indexFile
81-
.getInterfaceOrThrow("FooInterface")
82-
.getMethodOrThrow("fooMethod"),
83-
),
70+
docs(indexFile.getInterfaceOrThrow("FooInterface").getMethodOrThrow("fooMethod")),
8471
).toStrictEqual([
8572
"/** Docs for interface method overloads 1 */",
8673
"/** Docs for interface method overloads 2 */",
8774
]);
88-
expect(docs(indexFile.getTypeAliasOrThrow("Qux"))).toStrictEqual([
89-
"/** Docs for Qux */",
90-
]);
75+
expect(docs(indexFile.getTypeAliasOrThrow("Qux"))).toStrictEqual(["/** Docs for Qux */"]);
9176
});

src/docs.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ const nodesWithDocs = (node: Node): Node[] => {
2222
// Constructors can also be overloaded but they are excluded because
2323
// one item is returned per constructor each with its own docs.
2424
const implementation = node.getImplementation();
25-
return [
26-
...node.getOverloads(),
27-
...(implementation ? [implementation] : []),
28-
];
25+
return [...node.getOverloads(), ...(implementation ? [implementation] : [])];
2926
}
3027
if (
3128
Node.isMethodSignature(node) &&

src/export-equals-declarations.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import dedent from "ts-dedent";
2-
import {
3-
ModuleKind,
4-
ModuleResolutionKind,
5-
Project,
6-
ScriptTarget,
7-
} from "ts-morph";
2+
import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph";
83
import { expect, test } from "vitest";
94
import { exportEqualsDeclarations } from "./export-equals-declarations";
105

@@ -24,9 +19,7 @@ test("shorthand ambient module", () => {
2419
declare module 'foo';
2520
`,
2621
);
27-
expect(
28-
exportEqualsDeclarations("", indexFile.getModuleOrThrow("'foo'")),
29-
).toStrictEqual([]);
22+
expect(exportEqualsDeclarations("", indexFile.getModuleOrThrow("'foo'"))).toStrictEqual([]);
3023
});
3124

3225
test("export default", () => {

src/export-equals-declarations.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
ModuleDeclaration,
3-
SourceFile,
4-
SyntaxKind,
5-
type ExportedDeclarations,
6-
} from "ts-morph";
1+
import { ModuleDeclaration, SourceFile, SyntaxKind, type ExportedDeclarations } from "ts-morph";
72
import { isExportedDeclarations } from "./is-exported-declarations";
83
import { isHidden } from "./is-hidden";
94
import { isNamespace } from "./is-namespace";

0 commit comments

Comments
 (0)