Skip to content

Commit

Permalink
add "lf" eol for prettier as well (as-pect#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGraey authored May 6, 2021
1 parent e723601 commit daa161f
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
trailingComma: "all"
tabWidth: 2
semi: true
singleQuote: false
singleQuote: false
endOfLine: "lf"
1 change: 0 additions & 1 deletion packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export function run(cliOptions: Options, compilerArgs: string[]): void {
}
}


/** If the export table flag exists on the cli options, use the export table flag. */
if (exportTable) {
flags["--exportTable"] = [];
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/util/CommandLineArg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ export type ArgMap = Map<string, CommandLineArg>;
*/
export function makeArgMap(args: CommandLineArgs = _Args): ArgMap {
const res = new Map<string, CommandLineArg>();
Object.getOwnPropertyNames(args).forEach(element => {
Object.getOwnPropertyNames(args).forEach((element) => {
let arg = new CommandLineArg(element, _Args[element]);
res.set(element, arg);
let aliases = _Args[element].alias;
if (aliases) {
(Array.isArray(aliases) ? aliases : [aliases]).forEach(alias => {
(Array.isArray(aliases) ? aliases : [aliases]).forEach((alias) => {
// short aliases have a `-` prefix to disguish them
let name = (!alias.long ? "-" : "") + alias.name;
res.set(name, arg);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/removeFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { unlink } from "fs";
*/
export function removeFile(file: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
unlink(file, err => {
unlink(file, (err) => {
if (err) reject(err);
else resolve();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/writeFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function writeFile(
contents: Uint8Array | string,
): Promise<void> {
return new Promise<void>((resolve, reject) => {
fsWriteFile(file, contents, err => {
fsWriteFile(file, contents, (err) => {
if (err) reject(err);
else resolve();
});
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/reporter/CombinationReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export class CombinationReporter implements IReporter {
constructor(protected reporters: IReporter[]) {}

onEnter(ctx: TestContext, node: TestNode) {
this.reporters.forEach(e => e.onEnter(ctx, node));
this.reporters.forEach((e) => e.onEnter(ctx, node));
}

onExit(ctx: TestContext, node: TestNode) {
this.reporters.forEach(e => e.onExit(ctx, node));
this.reporters.forEach((e) => e.onExit(ctx, node));
}

onFinish(ctx: TestContext) {
this.reporters.forEach(e => e.onFinish(ctx));
this.reporters.forEach((e) => e.onFinish(ctx));
}
}
2 changes: 1 addition & 1 deletion packages/core/src/reporter/SummaryReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class SummaryReporter implements IReporter {

const todos = ([] as string[]).concat.apply(
[],
testGroups.map(e => e.groupTodos),
testGroups.map((e) => e.groupTodos),
).length;
const total = suite.testCount;
const passCount = suite.testPassCount;
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/test/TestContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export class TestContext {
/** The resulting snapshot diff. */
public snapshotDiff: SnapshotDiff | null = null;

constructor(props: ITestContextParameters) {``
constructor(props: ITestContextParameters) {
``;
this.rtrace = new Rtrace({
/* istanbul ignore next */
getMemory: () => {
Expand All @@ -181,7 +182,7 @@ export class TestContext {
oninfo: (msg: string) => {
/* istanbul ignore next */
return this.onRtraceInfo(msg);
}
},
}) as Rtrace & { blocks: Map<number, number> };
/* istanbul ignore next */
if (props.fileName) this.fileName = props.fileName;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/test/TestNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class TestNode {
get groupTodos(): string[] {
return (<string[]>[]).concat.apply(
this.todos,
this.groupTests.map(e => e.todos),
this.groupTests.map((e) => e.todos),
);
}

Expand All @@ -134,7 +134,7 @@ export class TestNode {
/** Get all the groups beneath this node. */
get childGroups(): TestNode[] {
const result: TestNode[] = [];
this.visit(node => {
this.visit((node) => {
if (node.type === TestNodeType.Group) result.push(node);
});
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function createIsDefinedIfStatement(
TypeNode.createAssertionExpression(
AssertionKind.AS,
TypeNode.createArrayLiteralExpression(
nameHashes.map(e =>
nameHashes.map((e) =>
TypeNode.createIntegerLiteralExpression(
f64_as_i64(e),
range,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/transform/createStrictEqualsMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function createStrictEqualsMember(
TypeNode.createNamedType(
TypeNode.createSimpleTypeName(classDeclaration.name.text, range),
classDeclaration.isGeneric
? classDeclaration.typeParameters!.map(node =>
? classDeclaration.typeParameters!.map((node) =>
TypeNode.createNamedType(
TypeNode.createSimpleTypeName(node.name.text, range),
null,
Expand Down Expand Up @@ -394,7 +394,7 @@ function createSuperCallExpression(
TypeNode.createAssertionExpression(
AssertionKind.AS,
TypeNode.createArrayLiteralExpression(
hashValues.map(e =>
hashValues.map((e) =>
TypeNode.createIntegerLiteralExpression(f64_as_i64(e), range),
),
range,
Expand Down

0 comments on commit daa161f

Please sign in to comment.