aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/options-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-24 23:47:57 -0500
committerGitHub <noreply@github.com>2024-02-25 04:47:57 +0000
commit73169f06dff767020718a5715eba97d3575ba7e1 (patch)
tree99d458f9d2ca74e67dbb4bccd148ef549f7ce2cf /ext/js/data/options-util.js
parenta21948daf6210f67955ae4f98a81e21b8cf9f1f2 (diff)
Turn on @typescript-eslint/no-unsafe-argument (#728)24.2.26.0
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r--ext/js/data/options-util.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index 8ef52972..de30f52a 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -22,6 +22,11 @@ import {escapeRegExp, isObject} from '../core/utilities.js';
import {TemplatePatcher} from '../templates/template-patcher.js';
import {JsonSchema} from './json-schema.js';
+// Some type safety rules are disabled for this file since it deals with upgrading an older format
+// of the options object to a newer format. SafeAny is used for much of this, since every single
+// legacy format does not contain type definitions.
+/* eslint-disable @typescript-eslint/no-unsafe-argument */
+
export class OptionsUtil {
constructor() {
/** @type {?TemplatePatcher} */
@@ -119,6 +124,9 @@ export class OptionsUtil {
}
});
});
+ if (typeof optionsStr !== 'string') {
+ throw new Error('Invalid value for options');
+ }
options = parseJson(optionsStr);
} catch (e) {
// NOP
@@ -1197,3 +1205,5 @@ export class OptionsUtil {
});
}
}
+
+/* eslint-enable @typescript-eslint/no-unsafe-argument */