From 8db6b436c7963615b21d948500af8aa5837806e3 Mon Sep 17 00:00:00 2001 From: ssube Date: Wed, 29 Jul 2020 07:36:15 -0500 Subject: [PATCH] fix(config): update lint to naming-convention rule --- config/eslint.json | 42 ++++++++++++++++++++++++++++++++++-- docs/api/js-utils.timeout.md | 4 ++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/config/eslint.json b/config/eslint.json index dc1c719..4d79504 100644 --- a/config/eslint.json +++ b/config/eslint.json @@ -35,7 +35,6 @@ } } ], - "@typescript-eslint/class-name-casing": "error", "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/consistent-type-definitions": "error", "@typescript-eslint/explicit-member-accessibility": [ @@ -61,7 +60,6 @@ "SwitchCase": 1 } ], - "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-delimiter-style": [ "error", { @@ -89,6 +87,45 @@ ] } ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "default", + "format": [ + "camelCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "variable", + "format": [ + "camelCase", + "UPPER_CASE" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "typeLike", + "format": [ + "PascalCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "interface", + "format": [ + "PascalCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid", + "prefix": [ + "I" + ] + } + ], "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "error", @@ -154,6 +191,7 @@ "error", "any", "Number", + "String", "Boolean", "Undefined" ], diff --git a/docs/api/js-utils.timeout.md b/docs/api/js-utils.timeout.md index 8f2a00a..23e6d37 100644 --- a/docs/api/js-utils.timeout.md +++ b/docs/api/js-utils.timeout.md @@ -9,7 +9,7 @@ Reject after a set amount of time if the original promise has not yet resolved. Signature: ```typescript -export declare function timeout(ms: number, oper: Promise): Promise; +export declare function timeout(ms: number, oper: Promise): Promise>; ``` ## Parameters @@ -21,5 +21,5 @@ export declare function timeout(ms: number, oper: Promise): Promise; Returns: -Promise<T> +Promise<[Optional](./js-utils.optional.md)<T>>