diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 51926d896..93a1c56b3 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -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 diff --git a/src/util/entropyCreateStateFromJsons.ts b/src/util/entropyCreateStateFromJsons.ts index bd042373e..0745c532a 100644 --- a/src/util/entropyCreateStateFromJsons.ts +++ b/src/util/entropyCreateStateFromJsons.ts @@ -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; }) @@ -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; } }