3 ms·
Our projects' linting rules specify no semicolons, except when necessary; this means that we will _very rarely_ write something like this when we want to iterat
by gknoy 9y ago
Our projects' linting rules specify no semicolons, except when necessary; this means that we will _very rarely_ write something like this when we want to iterate over a small literal array:
;['foo', 'bar'].forEach(function (f) {
it(`has an ${f} field`, function () {
expect(......)
})
}
That said, we tend to use that construct extremely rarely, such as in a few test cases where we are doing the same kinds of things on two groups of items that need different descriptions.
- WorldMaker 9y agoMost of my usages are Typescript type assertions: ;(thing as Type).methodINeed() If it weren't for these I mostly wouldn't need semicolons at all, sometimes I refactor to: const thingType = thing as Type thingType.methodINeed()