From 1bda4400201ecc31f959980de23f3fac0fd2f9ba Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Tue, 21 Jan 2020 17:01:21 +0900 Subject: [PATCH 1/2] [typescript-eslint] Enable explicit-module-boundary-types --- config/eslintrc_typescript.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/eslintrc_typescript.js b/config/eslintrc_typescript.js index 5b4fd264..3e8fc38f 100644 --- a/config/eslintrc_typescript.js +++ b/config/eslintrc_typescript.js @@ -74,8 +74,13 @@ module.exports = { }, }], - // TODO: #301 - '@typescript-eslint/explicit-module-boundary-types': 'off', + // Function's in/out are one of the important place to ensure type safety. + '@typescript-eslint/explicit-module-boundary-types': ['warn', { + 'allowTypedFunctionExpressions': true, + 'allowHigherOrderFunctions': false, + 'allowDirectConstAssertionInArrowFunctions': false, + 'allowedNames': [], + }], // * We accept the style for T , TA , TAbc , TA1Bca , T1 , T2. // * You seem this style is similar to C# or typescript compiler. From 7009704a3ce62995aa21403df005964040a39d61 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Tue, 21 Jan 2020 17:02:39 +0900 Subject: [PATCH 2/2] [typescript-eslint] Remove deprecated 'no-untyped-public-signature' --- config/eslintrc_typescript.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/eslintrc_typescript.js b/config/eslintrc_typescript.js index 3e8fc38f..ecd66eda 100644 --- a/config/eslintrc_typescript.js +++ b/config/eslintrc_typescript.js @@ -288,11 +288,6 @@ module.exports = { // We allow this this kind of redundant code because it sometimes prevents a mistake. '@typescript-eslint/no-unnecessary-type-assertion': 'off', - // I think this rule is useful. - // But I'm not sure about that the relation with `noImplicitAny` compiler option. - // FIXME(#257) - '@typescript-eslint/no-untyped-public-signature': 'off', - // This should be sorted with ESLint builtin rule. 'no-unused-expressions': 'off', '@typescript-eslint/no-unused-expressions': 'error',