Skip to content

Commit

Permalink
Move to prettier 2 (ot-builder#22)
Browse files Browse the repository at this point in the history
* Move prettier to 2.0

* Change files
  • Loading branch information
be5invis authored Mar 22, 2020
1 parent 51ae2ad commit 83d91f3
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# .prettierrc
printWidth: 99
useTabs: false
tabWidth: 4
tabWidth: 4
trailingComma: none
arrowParens: avoid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/bin-util",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:38.192Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/io-bin-cff",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:38.576Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/io-bin-layout",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:38.874Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/io-bin-metadata",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:39.162Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/io-bin-name",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:39.465Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"comment": "Move prettier to 2.0",
"packageName": "@ot-builder/prelude",
"email": "[email protected]",
"commit": "3b55b78dec952e06b9d11ddb88f954b99871f81e",
"dependentChangeType": "patch",
"date": "2020-03-22T22:15:40.120Z"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"jest": "^24.8.0",
"lerna": "^3.16.4",
"next": "^9.1.5",
"prettier": "^1.19.1",
"prettier": "^2.0.1",
"prettier-eslint": "^9.0.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
Expand Down
4 changes: 1 addition & 3 deletions packages/bin-util/src/handlers/fragments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ test("Frag: Shared Embed-relative Pointer", () => {
Frag.uint32(0x01020304),
FragPointerEmbedding.EmbedRelative
);
const root = Frag.ptr16(a)
.ptr16(Frag.uint32(0x01020304))
.embed(b);
const root = Frag.ptr16(a).ptr16(Frag.uint32(0x01020304)).embed(b);
expect([...Frag.pack(root)]).toEqual([
...[0, 8, 0, 10, 0, 4, 0, 6],
...[0, 2],
Expand Down
2 changes: 1 addition & 1 deletion packages/io-bin-cff/src/dict/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export abstract class CffDictInterpreterBase extends CffInterp.Interpreter {
}

export function CffDictReadT<T>(interpFactory: CffDictInterpreterFactory<T>) {
return Read(function(view: BinaryView, ctx: CffReadContext, dictSize: number) {
return Read(function (view: BinaryView, ctx: CffReadContext, dictSize: number) {
const interp = interpFactory(view, ctx);
const irSource = new CffDictIrSource(view, dictSize);
for (;;) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class CFeatureTableSubstitution<L> {
fOrd: Data.Order<Feature<L>>,
lOrd: Data.Order<L>
) {
frag.uint16(1)
.uint16(0)
.uint16(subst.size);
frag.uint16(1).uint16(0).uint16(subst.size);
for (const [from, to] of subst) {
frag.uint16(fOrd.reverse(from));
frag.ptr32New().push(new CFeatureTable<L>(), to, lOrd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class LookupListWriter<L extends GsubGpos.LookupProp> {
}
}

export const WriteLookupList = Write(function<L extends GsubGpos.LookupProp>(
export const WriteLookupList = Write(function <L extends GsubGpos.LookupProp>(
frag: Frag,
lookups: L[],
lwf: LookupWriterFactory<L>,
Expand Down
4 changes: 1 addition & 3 deletions packages/io-bin-layout/src/shared/class-def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ const OtGidClassDefFormat2 = {

frag.uint16(2).uint16(collector.runs.length);
for (const run of collector.runs) {
frag.uint16(run.startGlyphID)
.uint16(run.endGlyphID)
.uint16(run.class);
frag.uint16(run.startGlyphID).uint16(run.endGlyphID).uint16(run.class);
}
return frag;
})
Expand Down
4 changes: 1 addition & 3 deletions packages/io-bin-layout/src/shared/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ const OtGidCoverageFormat2 = {

frag.uint16(2).uint16(collector.runs.length);
for (const run of collector.runs) {
frag.uint16(run.startGlyphID)
.uint16(run.endGlyphID)
.uint16(run.startCoverageIndex);
frag.uint16(run.startGlyphID).uint16(run.endGlyphID).uint16(run.startCoverageIndex);
}
return frag;
})
Expand Down
4 changes: 1 addition & 3 deletions packages/io-bin-metadata/src/mvar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ export const MvarTableIo = {
if (rec.length) {
frag.ptr16(Frag.solidFrom(WriteTimeIVS, ivs, designSpace));
for (const [tag, outer, inner] of rec) {
frag.push(Tag, tag)
.uint16(outer)
.uint16(inner);
frag.push(Tag, tag).uint16(outer).uint16(inner);
}
} else {
if (afEmpty) afEmpty.set(true);
Expand Down
2 changes: 1 addition & 1 deletion packages/io-bin-metadata/src/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OtVar } from "@ot-builder/variance";

import macGlyphNames from "./mac-glyph-names";

const coMacGlyphNames: Map<string, number> = (function() {
const coMacGlyphNames: Map<string, number> = (function () {
const m = new Map<string, number>();
for (let nid = 0; nid < macGlyphNames.length; nid++) {
m.set(macGlyphNames[nid], nid);
Expand Down
6 changes: 1 addition & 5 deletions packages/io-bin-name/src/meta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ export const MetaTableIo = {
},
write(frag: Frag, table: Meta.Table) {
Assert.NoGap(`MetaTable::Data`, table.data);
frag.uint32(1)
.uint32(0)
.uint32(0)
.uint32(table.data.length)
.array(DataMap, table.data);
frag.uint32(1).uint32(0).uint32(0).uint32(table.data.length).array(DataMap, table.data);
}
};

Expand Down
9 changes: 2 additions & 7 deletions packages/io-bin-name/src/stat/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ const DesignAxisArray = Write((frag, axes: ReadonlyArray<Stat.Axis>) => {
for (const axis of axes) frag.push(DesignAxisRecord, axis);
});
const DesignAxisRecord = Write((frag, axis: Stat.Axis) => {
frag.push(Tag, axis.tag)
.uint16(axis.axisNameID)
.uint16(axis.axisOrdering);
frag.push(Tag, axis.tag).uint16(axis.axisNameID).uint16(axis.axisOrdering);
});

type AxisOrder = Data.Order<Stat.Axis>;
Expand Down Expand Up @@ -122,10 +120,7 @@ const AxisValueFormat3 = Write(
);
const AxisValueFormat4 = Write(
(frag, [av, asg]: [Stat.AxisValue.PolyAxis, Stat.NameAssignment], axes: AxisOrder) => {
frag.uint16(4)
.uint16(av.assignments.length)
.uint16(asg.flags)
.uint16(asg.valueNameID);
frag.uint16(4).uint16(av.assignments.length).uint16(asg.flags).uint16(asg.valueNameID);
for (const [axis, value] of av.assignments) {
frag.uint16(axes.reverse(axis)).push(F16D16, value);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/prelude/src/case/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function CaseCtorImpl<Tag, Props, A extends any[]>(
typeTag: Tag,
fn: (...args: A) => Props
): CaseCtorType<Tag, Props, A> {
return function(this: any, ...args: A) {
return function (this: any, ...args: A) {
initialize(this, typeTag, fn(...args));
} as any;
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-procs/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function Next(...args: string[]) {
}

export function Spawn(command: string, args: string[], options: CP.SpawnOptions) {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const cp = CP.spawn(command, args, options);

cp.on("error", reject).on("close", function(code) {
cp.on("error", reject).on("close", function (code) {
if (code === 0) {
resolve(null);
} else {
Expand Down

0 comments on commit 83d91f3

Please sign in to comment.