Commit 84b7672a authored by Robert Knight's avatar Robert Knight

Fix unwanted lint errors about type definition order in types/annotator.ts

The TypeScript compiler does not require type definitions to come before their
use, so this is a stylistic preference.

Per the docs [1], it is necessary to first disable ESLint's no-use-before-define
rule to avoid incorrect warnings in TS code, and then enable the corresponding
TS version with `ignoreTypeReferences` and `typedefs` set as desired.

[1] https://typescript-eslint.io/rules/no-use-before-define
parent 561f5122
......@@ -16,6 +16,18 @@
// Upgrade TS rules from warning to error.
"@typescript-eslint/no-unused-vars": "error",
// Replace no-use-before-define with TS version, to avoid incorrect warnings.
// See https://typescript-eslint.io/rules/no-use-before-define
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": false,
"typedefs": false,
"ignoreTypeReferences": false
}
],
// Disable TS rules that we dislike.
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment