Skip to content

Commit

Permalink
Merge pull request #1914: Stricter types
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Nov 21, 2024
2 parents f9d7ec7 + 6215591 commit 9e1ea80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ globals:
rules:
# Code quality rules
eqeqeq: error
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: 'never' }]
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }]
"@typescript-eslint/no-explicit-any": off # Allow explicit any to make incremental TypeScript adoption easier.
# TODO: use strict ruleset which includes no-non-null-assertion.
# Not possible while strictNullChecks is disabled in tsconfig.
"@typescript-eslint/no-non-null-assertion": "error"
no-unused-vars: off
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }]
no-use-before-define: off
Expand Down
4 changes: 2 additions & 2 deletions src/util/entropyCreateStateFromJsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const genomeMap = (annotations: JsonAnnotations): GenomeAnnotation => {
.map(([annotationKey, annotation]) => {
const geneName = annotation.gene || annotationKey;
if (!(geneName in annotationsPerGene)) annotationsPerGene[geneName] = {};
const gene = annotationsPerGene[geneName] as JsonAnnotations; // TODO - why do I need to cast?
const gene = annotationsPerGene[geneName];
gene[annotationKey] = annotation;
})

Expand Down Expand Up @@ -167,7 +167,7 @@ function validColor(color:(string|undefined)) {
function* nextColorGenerator() {
let i=0;
while (true) {
yield genotypeColors[i++] as string;
yield genotypeColors[i++];
if (i===genotypeColors.length) i=0;
}
}
Expand Down

0 comments on commit 9e1ea80

Please sign in to comment.