diff --git a/src/plugins/git/createGraph.js b/src/plugins/git/createGraph.js index 36d4c46..28bbabb 100644 --- a/src/plugins/git/createGraph.js +++ b/src/plugins/git/createGraph.js @@ -71,9 +71,7 @@ class GraphCreator { target = {type: GN.COMMIT_TYPE, hash: entry.hash}; break; default: - // eslint-disable-next-line no-unused-expressions - (entry.type: empty); - throw new Error(String(entry.type)); + throw new Error(String((entry.type: empty))); } this.graph.addNode(GN.toRaw(target)); this.graph.addEdge(GE.createEdge.hasContents(entryNode, target)); diff --git a/src/plugins/git/edges.js b/src/plugins/git/edges.js index 89ac99f..9bba995 100644 --- a/src/plugins/git/edges.js +++ b/src/plugins/git/edges.js @@ -237,8 +237,6 @@ export function toRaw(x: StructuredAddress): RawAddress { ...lengthEncode(GitNode.toRaw(x.treeEntry)) ); default: - // eslint-disable-next-line no-unused-expressions - (x.type: empty); - throw new Error(x.type); + throw new Error((x.type: empty)); } } diff --git a/src/plugins/git/nodes.js b/src/plugins/git/nodes.js index eed54d2..6f61a99 100644 --- a/src/plugins/git/nodes.js +++ b/src/plugins/git/nodes.js @@ -102,8 +102,6 @@ export function toRaw(x: StructuredAddress): RawAddress { case TREE_ENTRY_TYPE: return NodeAddress.append(_Prefix.treeEntry, x.treeHash, x.name); default: - // eslint-disable-next-line no-unused-expressions - (x.type: empty); - throw new Error(`Unexpected type ${x.type}`); + throw new Error(`Unexpected type ${(x.type: empty)}`); } } diff --git a/src/plugins/github/edges.js b/src/plugins/github/edges.js index 6495967..770f930 100644 --- a/src/plugins/github/edges.js +++ b/src/plugins/github/edges.js @@ -215,8 +215,6 @@ export function toRaw(x: StructuredAddress): RawAddress { ...lengthEncode(GithubNode.toRaw(x.referent)) ); default: - // eslint-disable-next-line no-unused-expressions - (x.type: empty); - throw new Error(x.type); + throw new Error((x.type: empty)); } } diff --git a/src/plugins/github/nodes.js b/src/plugins/github/nodes.js index e59c42b..5e60818 100644 --- a/src/plugins/github/nodes.js +++ b/src/plugins/github/nodes.js @@ -261,15 +261,11 @@ export function toRaw(x: StructuredAddress): RawAddress { x.id ); default: - // eslint-disable-next-line no-unused-expressions - (x.parent.type: empty); - throw new Error(`Bad comment parent type: ${x.parent.type}`); + throw new Error(`Bad comment parent type: ${(x.parent.type: empty)}`); } case USERLIKE_TYPE: return NodeAddress.append(_Prefix.userlike, x.login); default: - // eslint-disable-next-line no-unused-expressions - (x.type: empty); - throw new Error(`Unexpected type ${x.type}`); + throw new Error(`Unexpected type ${(x.type: empty)}`); } } diff --git a/src/plugins/github/parseMarkdown.js b/src/plugins/github/parseMarkdown.js index f0127e6..e933717 100644 --- a/src/plugins/github/parseMarkdown.js +++ b/src/plugins/github/parseMarkdown.js @@ -108,9 +108,7 @@ export function deformat(ast: Node): void { case "custom_block": break; default: - // eslint-disable-next-line no-unused-expressions - (type: empty); - throw new Error("unexpected type: " + type); + throw new Error("unexpected type: " + (type: empty)); } } } diff --git a/src/plugins/github/relationalView.js b/src/plugins/github/relationalView.js index 111c9a4..54bbe3a 100644 --- a/src/plugins/github/relationalView.js +++ b/src/plugins/github/relationalView.js @@ -322,9 +322,9 @@ export class RelationalView { case N.REVIEW_TYPE: return reviewCommentUrlToId(json.url); default: - // eslint-disable-next-line no-unused-expressions - (parent.type: empty); - throw new Error(`Unexpected comment parent type: ${parent.type}`); + throw new Error( + `Unexpected comment parent type: ${(parent.type: empty)}` + ); } })(); const address: CommentAddress = {type: N.COMMENT_TYPE, id, parent}; @@ -405,9 +405,7 @@ export class RelationalView { this._addExtraAuthor(e, userlike); break; default: - // eslint-disable-next-line no-unused-expressions - (refType: empty); - throw new Error(`Unexpected refType: ${refType}`); + throw new Error(`Unexpected refType: ${(refType: empty)}`); } } } @@ -461,10 +459,8 @@ export class RelationalView { entity = this.comment(address); break; default: - // eslint-disable-next-line no-unused-expressions - (address.type: empty); throw new Error( - `Unexpected referrer address type: ${address.type}` + `Unexpected referrer address type: ${(address.type: empty)}` ); } if (entity == null) { @@ -506,10 +502,8 @@ export class RelationalView { entity = this.userlike(address); break; default: - // eslint-disable-next-line no-unused-expressions - (address.type: empty); throw new Error( - `Unexpected referent address type: ${address.type}` + `Unexpected referent address type: ${(address.type: empty)}` ); } if (entity == null) { @@ -758,9 +752,7 @@ export class Comment extends _Entity { parent = this._view.review(address); break; default: - // eslint-disable-next-line no-unused-expressions - (address.type: empty); - throw new Error(`Unexpected parent address: ${stringify(address)}`); + throw new Error(`Bad parent address type: ${(address.type: empty)}`); } return assertExists(parent, address); }