Merge pull request #886 from kalman/comma-dangle

Add comma-dangle: always-multiline to eslint rules.
This commit is contained in:
Ben Kalman
2016-01-20 15:22:55 -08:00
25 changed files with 107 additions and 106 deletions

View File

@@ -27,7 +27,7 @@ export default class Chart extends React.Component<void, Props, State> {
isArea: true,
showControls: false,
showLegend: false,
useInteractiveGuideline: true
useInteractiveGuideline: true,
});
chart.yScale(d3.scale.log());

View File

@@ -12,7 +12,7 @@ import {
Ref,
registerPackage,
SetLeafSequence,
Struct
Struct,
} from 'noms';
import type {ChunkStore, Package} from 'noms';
@@ -154,22 +154,22 @@ export default class DataManager {
const [seedData, seriesAData, seriesBData] = await Promise.all([
seedSet.intersect(categorySet, timeSet).then(set => set.map(getAmountRaised)),
seriesASet.intersect(categorySet, timeSet).then(set => set.map(getAmountRaised)),
seriesBSet.intersect(categorySet, timeSet).then(set => set.map(getAmountRaised))
seriesBSet.intersect(categorySet, timeSet).then(set => set.map(getAmountRaised)),
]);
return this._data = [
{
values: percentiles(seedData),
key: 'Seed'
key: 'Seed',
},
{
values: percentiles(seriesAData),
key: 'A'
key: 'A',
},
{
values: percentiles(seriesBData),
key: 'B'
}
key: 'B',
},
];
}

View File

@@ -11,21 +11,21 @@ import type {ListDelegate} from './list.js';
type LabelAndKey = {
label: string,
key: Object
key: Object,
};
type Props = {
series: Array<string>,
timeItems: Array<LabelAndKey>,
categories: Array<string>,
color: Array<string>
color: Array<string>,
};
type State = {
selectedSeries: Set<string>,
selectedTimeItem: LabelAndKey,
selectedCategoryItem: string,
data: DataArray
data: DataArray,
};
const nomsServer: ?string = process.env.NOMS_SERVER;
@@ -52,7 +52,7 @@ class Main extends React.Component<void, Props, State> {
selectedSeries: new Set(this.props.series),
selectedTimeItem,
selectedCategoryItem,
data: []
data: [],
};
}
@@ -107,7 +107,7 @@ class Main extends React.Component<void, Props, State> {
selectedSeries.add(item);
}
this.setState({selectedSeries});
}
},
};
const timeDelegate: ListDelegate<LabelAndKey> = {
@@ -119,7 +119,7 @@ class Main extends React.Component<void, Props, State> {
},
onChange: (item: LabelAndKey) => {
this._selectedTimeChanged(item);
}
},
};
const categoryDelegate: ListDelegate<string> = {
@@ -131,7 +131,7 @@ class Main extends React.Component<void, Props, State> {
},
onChange: (item: string) => {
this._selectedCategoryChanged(item);
}
},
};
return <div className='app'>
@@ -160,14 +160,14 @@ const qYear = d.getFullYear();
const quarter = (d.getMonth() + 1) / 4 | 0;
const timeItems = [
{label: 'Current Year', key: {Year: year}},
{label: 'Last Quarter', key: {Year: qYear, Quarter: quarter}}
{label: 'Last Quarter', key: {Year: qYear, Quarter: quarter}},
];
const categories = [
'Biotechnology',
'Finance',
'Games',
'Software'
'Software',
];
const color = ['#011f4b', '#03396c', '#005b96'];

View File

@@ -37,7 +37,7 @@ export default class HeatMap extends React.Component<void, Props, State> {
this.state = {
loaded: false,
pointList: []
pointList: [],
};
}
@@ -54,12 +54,12 @@ export default class HeatMap extends React.Component<void, Props, State> {
await pitchList.forEach(p => {
pointList.push({
x: -1 + ORIGIN_X_PIXELS + feetToPixels(p.get('X')),
y: -1 + ORIGIN_Z_PIXELS - feetToPixels(p.get('Z'))
y: -1 + ORIGIN_Z_PIXELS - feetToPixels(p.get('Z')),
});
});
this.setState({
loaded: true,
pointList: pointList
pointList: pointList,
});
} else {
throw new Error('Unexpected type of pitchList');
@@ -75,13 +75,13 @@ export default class HeatMap extends React.Component<void, Props, State> {
left: 0,
position: 'absolute',
right: 0,
top: 0
top: 0,
};
return <div style={ {
position: 'relative',
overflow: 'hidden',
width: IMAGE_WIDTH_PX,
height: IMAGE_HEIGHT_PX
height: IMAGE_HEIGHT_PX,
} }>
<img src="background.jpg" style={fillStyle}/>
<div style={fillStyle}>
@@ -101,7 +101,7 @@ export default class HeatMap extends React.Component<void, Props, State> {
width: '2px',
height: '2px',
boxShadow: '0px 0px 16px 16px rgba(0,255,0,0.4)',
borderRadius: '50%'
borderRadius: '50%',
}
}/>;
});

View File

@@ -47,7 +47,7 @@ class PitcherList extends React.Component<void, Props, State> {
super(props);
this.state = {
currentPitcher: props.pitchers[0]
currentPitcher: props.pitchers[0],
};
}
@@ -57,7 +57,7 @@ class PitcherList extends React.Component<void, Props, State> {
const onChangePitcher = e => {
this.setState({
currentPitcher: e.target.value
currentPitcher: e.target.value,
});
};

View File

@@ -4,7 +4,7 @@ import Layout from './layout.js';
import React from 'react'; // eslint-disable-line no-unused-vars
import ReactDOM from 'react-dom';
import {HttpStore, invariant, IndexedMetaSequence, ListLeafSequence, MapLeafSequence,
OrderedMetaSequence, NomsList, NomsMap, NomsSet, readValue, Ref, SetLeafSequence, Struct}
OrderedMetaSequence, NomsList, NomsMap, NomsSet, readValue, Ref, SetLeafSequence, Struct,}
from 'noms';
import {layout, NodeGraph, TreeNode} from './buchheim.js';
@@ -130,7 +130,7 @@ function handleChunkLoad(ref: Ref, val: any, fromRef: ?string) {
data.nodes[id] = {
canOpen: true,
name: refStr.substr(5, 6),
fullName: refStr
fullName: refStr,
};
} else if (val instanceof Struct) {
// Struct

View File

@@ -27,7 +27,7 @@ export default class Node extends React.Component<void, Props, State> {
this.state = {
x: this.props.fromX,
y: this.props.fromY
y: this.props.fromY,
};
}
@@ -36,7 +36,7 @@ export default class Node extends React.Component<void, Props, State> {
this.state.y !== this.props.y) {
window.requestAnimationFrame(() => this.setState({
x: this.props.x,
y: this.props.y
y: this.props.y,
}));
}

View File

@@ -25,7 +25,7 @@ export default class DatasetPicker extends React.Component<DefaultProps, Props,
constructor(props: Props) {
super(props);
this.state = {
datasets: new Set()
datasets: new Set(),
};
}
@@ -44,7 +44,7 @@ export default class DatasetPicker extends React.Component<DefaultProps, Props,
s.add(k);
});
this.setState({
datasets: s
datasets: s,
});
}

View File

@@ -35,7 +35,7 @@ suite('eq', () => {
new Map([[10, 12]]),
new Map([[10, 11], [13, 14]]),
r0,
r1
r1,
];
for (let i = 0; i < different.length; i++) {
for (let j = 0; j < different.length; j++) {
@@ -54,7 +54,7 @@ suite('eq', () => {
[new Set([{a: 1}]), new Set([{a: 1}])],
[new Map([[{a: 1}, {b: 2}]]), new Map([[{a: 1}, {b: 2}]])],
[new Set([r1]), new Set([r2])],
[new Map([[r1, 42]]), new Map([[r2, 42]])]
[new Map([[r1, 42]]), new Map([[r2, 42]])],
];
for (const vs of same) {
for (let i = 0; i < vs.length; i++) {

View File

@@ -28,7 +28,7 @@ export default class Photo extends React.Component<DefaultProps, Props, State> {
super(props);
this.state = {
photo: null,
sizes: []
sizes: [],
};
}
@@ -82,5 +82,5 @@ export default class Photo extends React.Component<DefaultProps, Props, State> {
}
Photo.defaultProps = {
onLoad() {}
onLoad() {},
};

View File

@@ -7,12 +7,12 @@ import type {ChunkStore, Ref} from 'noms';
const photoStyle = {
display: 'inline-block',
marginRight: 5,
height: 300
height: 300,
};
type Props = {
photos: Array<Ref>,
store: ChunkStore
store: ChunkStore,
};
export default function Preview(props: Props) : React.Element {

View File

@@ -13,13 +13,13 @@ type QueryStringObject = {[key: string]: string};
type Props = {
store: ChunkStore,
qs: QueryStringObject,
updateQuery: (qs: QueryStringObject) => void
updateQuery: (qs: QueryStringObject) => void,
};
type State = {
selectedTags: Set<string>,
selectedPhotos: Array<Ref>,
tags: Array<string>
tags: Array<string>,
};
export default class Root extends React.Component<void, Props, State> {
@@ -28,7 +28,7 @@ export default class Root extends React.Component<void, Props, State> {
this.state = {
selectedTags: new Set(),
selectedPhotos: [],
tags: []
tags: [],
};
}

View File

@@ -14,23 +14,23 @@ const containerStyle = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
};
type Props = {
store: ChunkStore,
photos: Array<Ref>
photos: Array<Ref>,
};
type State = {
index: number
index: number,
};
export default class SlideShow extends React.Component<void, Props, State> {
constructor(props: Props) {
super(props);
this.state = {
index: 0
index: 0,
};
}
@@ -73,13 +73,13 @@ class Item extends React.Component<void, ItemProps, ItemState> {
constructor(props: ItemProps) {
super(props);
this.state = {
timerId: 0
timerId: 0,
};
}
setTimeout() {
this.setState({
timerId: window.setTimeout(this.props.onTimeout, 3000)
timerId: window.setTimeout(this.props.onTimeout, 3000),
});
}
@@ -91,7 +91,7 @@ class Item extends React.Component<void, ItemProps, ItemState> {
const style = {
objectFit: 'contain',
width: window.innerWidth,
height: window.innerHeight
height: window.innerHeight,
};
return (

View File

@@ -9,36 +9,36 @@ const styles = {
root: {
display: 'flex',
flexDirection: 'column',
height: '100%'
height: '100%',
},
panes: {
display: 'flex',
flex: 1
flex: 1,
},
left: {
overflowX: 'hidden',
overflowY: 'auto',
marginRight: '1em'
marginRight: '1em',
},
right: {
flex: 1,
overflowX: 'hidden',
overflowY: 'auto',
padding: '1em'
padding: '1em',
},
bottom: {
textAlign: 'center'
textAlign: 'center',
},
button: {
fontSize: '1.5em',
margin: '1em',
width: '50%'
}
width: '50%',
},
};
type Props = {
@@ -47,7 +47,7 @@ type Props = {
selectedPhotos: Array<Ref>,
selectedTags: Set<string>,
onChange: (selected: Set<string>) => void,
onConfirm: () => void
onConfirm: () => void,
};
export default function TagChooser(props: Props) : React.Element {

View File

@@ -6,13 +6,13 @@ const tagStyle = {
display: 'block',
margin: '3px',
marginRight: '25px',
whiteSpace: 'nowrap'
whiteSpace: 'nowrap',
};
type Props = {
selected: Set<string>,
tags: Array<string>,
onChange: (selected: Set<string>) => void
onChange: (selected: Set<string>) => void,
};
function handleChange(props: Props, tag: string) {

View File

@@ -3,6 +3,7 @@
"rules": {
"array-bracket-spacing": [2, "never"],
"camelcase": 2,
"comma-dangle": [2, "always-multiline"],
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],

View File

@@ -9,7 +9,7 @@ import type {float64, int32, int64, uint8, uint16, uint32, uint64} from './primi
import type {TypeDesc} from './type.js';
import {assert} from 'chai';
import {decodeNomsValue, JsonArrayReader} from './decode.js';
import {Field, makeCompoundType, makeEnumType, makePrimitiveType, makeStructType, makeType, Type}
import {Field, makeCompoundType, makeEnumType, makePrimitiveType, makeStructType, makeType, Type,}
from './type.js';
import {IndexedMetaSequence, MetaTuple} from './meta_sequence.js';
import {invariant, notNull} from './assert.js';
@@ -141,7 +141,7 @@ suite('Decode', () => {
const tuples = [
new MetaTuple(r1, 2),
new MetaTuple(r2, 4),
new MetaTuple(r3, 6)
new MetaTuple(r3, 6),
];
const l:NomsList<int32> = new NomsList(ms, ltr, new IndexedMetaSequence(ltr, tuples));
invariant(l instanceof NomsList);
@@ -236,7 +236,7 @@ suite('Decode', () => {
const tr = makeStructType('A1', [
new Field('x', makePrimitiveType(Kind.Int16), false),
new Field('s', makePrimitiveType(Kind.String), false),
new Field('b', makePrimitiveType(Kind.Bool), false)
new Field('b', makePrimitiveType(Kind.Bool), false),
], []);
const pkg = new Package([tr], []);
@@ -249,17 +249,17 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
x: 42,
s: 'hi',
b: true
b: true,
});
});
test('test read struct union', async () => {
const ms = new MemoryStore();
const tr = makeStructType('A2', [
new Field('x', makePrimitiveType(Kind.Float32), false)
new Field('x', makePrimitiveType(Kind.Float32), false),
], [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
]);
const pkg = new Package([tr], []);
@@ -271,7 +271,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
x: 42,
s: 'hi'
s: 'hi',
});
});
@@ -280,7 +280,7 @@ suite('Decode', () => {
const tr = makeStructType('A3', [
new Field('x', makePrimitiveType(Kind.Float32), false),
new Field('s', makePrimitiveType(Kind.String), true),
new Field('b', makePrimitiveType(Kind.Bool), true)
new Field('b', makePrimitiveType(Kind.Bool), true),
], []);
const pkg = new Package([tr], []);
@@ -292,7 +292,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
x: 42,
b: false
b: false,
});
});
@@ -303,7 +303,7 @@ suite('Decode', () => {
const tr = makeStructType('A4', [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('l', ltr, false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
], []);
const pkg = new Package([tr], []);
@@ -316,7 +316,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
b: true,
l: new NomsList(ms, ltr, new ListLeafSequence(ltr, [0, 1, 2])),
s: 'hi'
s: 'hi',
});
});
@@ -325,7 +325,7 @@ suite('Decode', () => {
const tr = makeStructType('A5', [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('v', makePrimitiveType(Kind.Value), false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
], []);
const pkg = new Package([tr], []);
@@ -338,7 +338,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
b: true,
v: 42,
s: 'hi'
s: 'hi',
});
});
@@ -347,7 +347,7 @@ suite('Decode', () => {
const tr = makeStructType('A1', [
new Field('x', makePrimitiveType(Kind.Int16), false),
new Field('s', makePrimitiveType(Kind.String), false),
new Field('b', makePrimitiveType(Kind.Bool), false)
new Field('b', makePrimitiveType(Kind.Bool), false),
], []);
const pkg = new Package([tr], []);
@@ -360,7 +360,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
x: 42,
s: 'hi',
b: true
b: true,
});
});
@@ -397,7 +397,7 @@ suite('Decode', () => {
const tr = makeStructType('A1', [
new Field('x', makePrimitiveType(Kind.Int16), false),
new Field('e', makeType(new Ref(), 1), false),
new Field('b', makePrimitiveType(Kind.Bool), false)
new Field('b', makePrimitiveType(Kind.Bool), false),
], []);
const enumTref = makeEnumType('E', ['a', 'b', 'c']);
const pkg = new Package([tr, enumTref], []);
@@ -410,7 +410,7 @@ suite('Decode', () => {
assertStruct(v, tr.desc, {
x: 42,
e: 1,
b: true
b: true,
});
});
@@ -418,7 +418,7 @@ suite('Decode', () => {
const ms = new MemoryStore();
const tr = makeStructType('s', [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('i', makePrimitiveType(Kind.Int32), false)
new Field('i', makePrimitiveType(Kind.Int32), false),
], []);
const pkg = new Package([tr], []);

View File

@@ -9,7 +9,7 @@ import Struct from './struct.js';
import test from './async_test.js';
import type {NomsKind} from './noms_kind.js';
import {encodeNomsValue, JsonArrayWriter} from './encode.js';
import {Field, makeCompoundType, makeEnumType, makePrimitiveType, makeStructType, makeType, Type}
import {Field, makeCompoundType, makeEnumType, makePrimitiveType, makeStructType, makeType, Type,}
from './type.js';
import {IndexedMetaSequence, MetaTuple} from './meta_sequence.js';
import {Kind} from './noms_kind.js';
@@ -75,7 +75,7 @@ suite('Encode', () => {
const tr = makeCompoundType(Kind.List, it);
const v = new NomsList(ms, tr, new ListLeafSequence(tr, [
new NomsList(ms, tr, new ListLeafSequence(it, [0])),
new NomsList(ms, tr, new ListLeafSequence(it, [1, 2, 3]))
new NomsList(ms, tr, new ListLeafSequence(it, [1, 2, 3])),
]));
w.writeTopLevel(tr, v);
assert.deepEqual([Kind.List, Kind.List, Kind.Int16, false, [false, ['0'], false,
@@ -100,7 +100,7 @@ suite('Encode', () => {
const tr = makeCompoundType(Kind.Set, st);
const v = new NomsSet(ms, tr, new SetLeafSequence(tr, [
new NomsSet(ms, tr, new SetLeafSequence(st, [0])),
new NomsSet(ms, tr, new SetLeafSequence(st, [1, 2, 3]))
new NomsSet(ms, tr, new SetLeafSequence(st, [1, 2, 3])),
]));
w.writeTopLevel(tr, v);
@@ -159,7 +159,7 @@ suite('Encode', () => {
const typeDef = makeStructType('S', [
new Field('x', makePrimitiveType(Kind.Int8), false),
new Field('b', makePrimitiveType(Kind.Bool), false)
new Field('b', makePrimitiveType(Kind.Bool), false),
], []);
const pkg = new Package([typeDef], []);
registerPackage(pkg);
@@ -178,7 +178,7 @@ suite('Encode', () => {
const typeDef = makeStructType('S', [
new Field('x', makePrimitiveType(Kind.Int8), true),
new Field('b', makePrimitiveType(Kind.Bool), false)
new Field('b', makePrimitiveType(Kind.Bool), false),
], []);
const pkg = new Package([typeDef], []);
registerPackage(pkg);
@@ -200,10 +200,10 @@ suite('Encode', () => {
let w = new JsonArrayWriter(ms);
const typeDef = makeStructType('S', [
new Field('x', makePrimitiveType(Kind.Int8), false)
new Field('x', makePrimitiveType(Kind.Int8), false),
], [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
]);
const pkg = new Package([typeDef], []);
registerPackage(pkg);
@@ -226,7 +226,7 @@ suite('Encode', () => {
const ltr = makeCompoundType(Kind.List, makePrimitiveType(Kind.String));
const typeDef = makeStructType('S', [
new Field('l', ltr, false)
new Field('l', ltr, false),
], []);
const pkg = new Package([typeDef], []);
registerPackage(pkg);
@@ -249,10 +249,10 @@ suite('Encode', () => {
const w = new JsonArrayWriter(ms);
const s2TypeDef = makeStructType('S2', [
new Field('x', makePrimitiveType(Kind.Int32), false)
new Field('x', makePrimitiveType(Kind.Int32), false),
], []);
const sTypeDef = makeStructType('S', [
new Field('s', makeType(new Ref(), 0), false)
new Field('s', makeType(new Ref(), 0), false),
], []);
const pkg = new Package([s2TypeDef, sTypeDef], []);
@@ -306,7 +306,7 @@ suite('Encode', () => {
const tuples = [
new MetaTuple(r1, 2),
new MetaTuple(r2, 4),
new MetaTuple(r3, 6)
new MetaTuple(r3, 6),
];
const l = new NomsList(ms, ltr, new IndexedMetaSequence(ltr, tuples));
@@ -333,12 +333,12 @@ suite('Encode', () => {
test([Kind.Type, Kind.Struct, 'S', ['x', Kind.Int16, false, 'v', Kind.Value, true], []],
makeStructType('S', [
new Field('x', makePrimitiveType(Kind.Int16), false),
new Field('v', makePrimitiveType(Kind.Value), true)
new Field('v', makePrimitiveType(Kind.Value), true),
], []));
test([Kind.Type, Kind.Struct, 'S', [], ['x', Kind.Int16, false, 'v', Kind.Value, false]],
makeStructType('S', [], [
new Field('x', makePrimitiveType(Kind.Int16), false),
new Field('v', makePrimitiveType(Kind.Value), false)
new Field('v', makePrimitiveType(Kind.Value), false),
]));
const pkgRef = Ref.parse('sha1-0123456789abcdef0123456789abcdef01234567');
@@ -348,7 +348,7 @@ suite('Encode', () => {
['e', Kind.Unresolved, pkgRef.toString(), '123', false, 'x', Kind.Int64, false], []],
makeStructType('S', [
new Field('e', makeType(pkgRef, 123), false),
new Field('x', makePrimitiveType(Kind.Int64), false)
new Field('x', makePrimitiveType(Kind.Int64), false),
], []));
// test([Kind.Type, Kind.Unresolved, new Ref().toString(), -1, 'ns', 'n'],

View File

@@ -23,7 +23,7 @@ export default class HttpStore {
this._rpc = {
getRefs: url + '/getRefs/',
ref: url + '/ref/',
root: url + '/root/'
root: url + '/root/',
};
this._readQueue = Object.create(null);
this._anyPending = false;
@@ -86,8 +86,8 @@ export default class HttpStore {
method: 'post',
body: body,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
'Content-Type': 'application/x-www-form-urlencoded',
},
});
const chunks = deserialize(buffer);

View File

@@ -30,7 +30,7 @@ export {
StructDesc,
Type,
typeType,
UnresolvedDesc
UnresolvedDesc,
} from './type.js';
import type {ChunkStore} from './chunk_store.js';

View File

@@ -25,7 +25,7 @@ export const Kind: {
Struct: NomsKind,
Type: NomsKind,
Unresolved: NomsKind,
Package: NomsKind
Package: NomsKind,
} = {
Bool: 0,
Uint8: 1,
@@ -49,7 +49,7 @@ export const Kind: {
Struct: 19,
Type: 20,
Unresolved: 21,
Package: 22
Package: 22,
};
export function isPrimitiveKind(k: NomsKind): boolean {

View File

@@ -14,7 +14,7 @@ suite('Struct', () => {
test('equals', () => {
const typeDef = makeStructType('S1', [
new Field('x', makePrimitiveType(Kind.Bool), false),
new Field('o', makePrimitiveType(Kind.String), true)
new Field('o', makePrimitiveType(Kind.String), true),
], []);
const pkg = new Package([typeDef], []);
@@ -32,7 +32,7 @@ suite('Struct', () => {
test('chunks', () => {
const ms = new MemoryStore();
const typeDef = makeStructType('S1', [
new Field('r', makeCompoundType(Kind.Ref, makePrimitiveType(Kind.Bool)), false)
new Field('r', makeCompoundType(Kind.Ref, makePrimitiveType(Kind.Bool)), false),
], []);
const pkg = new Package([typeDef], []);
@@ -52,7 +52,7 @@ suite('Struct', () => {
test('chunks optional', () => {
const ms = new MemoryStore();
const typeDef = makeStructType('S1', [
new Field('r', makeCompoundType(Kind.Ref, makePrimitiveType(Kind.Bool)), true)
new Field('r', makeCompoundType(Kind.Ref, makePrimitiveType(Kind.Bool)), true),
], []);
const pkg = new Package([typeDef], []);
@@ -78,7 +78,7 @@ suite('Struct', () => {
const ms = new MemoryStore();
const typeDef = makeStructType('S1', [], [
new Field('r', makeCompoundType(Kind.Ref, makePrimitiveType(Kind.Bool)), false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
]);
const pkg = new Package([typeDef], []);
@@ -102,7 +102,7 @@ suite('Struct', () => {
test('new', () => {
const typeDef = makeStructType('S2', [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('o', makePrimitiveType(Kind.String), true)
new Field('o', makePrimitiveType(Kind.String), true),
], []);
const pkg = new Package([typeDef], []);
@@ -132,7 +132,7 @@ suite('Struct', () => {
test('new union', () => {
const typeDef = makeStructType('S3', [], [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('o', makePrimitiveType(Kind.String), false)
new Field('o', makePrimitiveType(Kind.String), false),
]);
const pkg = new Package([typeDef], []);
@@ -148,7 +148,7 @@ suite('Struct', () => {
test('struct set', () => {
const typeDef = makeStructType('S3', [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('o', makePrimitiveType(Kind.String), true)
new Field('o', makePrimitiveType(Kind.String), true),
], []);
const pkg = new Package([typeDef], []);
@@ -190,7 +190,7 @@ suite('Struct', () => {
test('struct set union', () => {
const typeDef = makeStructType('S3', [], [
new Field('b', makePrimitiveType(Kind.Bool), false),
new Field('s', makePrimitiveType(Kind.String), false)
new Field('s', makePrimitiveType(Kind.String), false),
]);
const pkg = new Package([typeDef], []);

View File

@@ -6,7 +6,7 @@ declare var TextEncoder: ?Function;
import {
TextDecoder as TextDecoderPolyfill,
TextEncoder as TextEncoderPolyfill
TextEncoder as TextEncoderPolyfill,
} from 'text-encoding-utf-8';
const TextDecoderImpl = typeof TextDecoder === 'function' ? TextDecoder : TextDecoderPolyfill;

View File

@@ -356,5 +356,5 @@ export {
Type,
typeType,
packageType,
UnresolvedDesc
UnresolvedDesc,
};

View File

@@ -21,11 +21,11 @@ suite('Type', () => {
const setType = makeCompoundType(Kind.Set, stringType);
const mahType = makeStructType('MahStruct', [
new Field('Field1', stringType, false),
new Field('Field2', boolType, true)
new Field('Field2', boolType, true),
], []);
const otherType = makeStructType('MahOtherStruct', [], [
new Field('StructField', mahType, false),
new Field('StringField', stringType, false)
new Field('StringField', stringType, false),
]);
const pkgRef = Ref.parse('sha1-0123456789abcdef0123456789abcdef01234567');