Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stricter types #1914

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading