From 3f106a050bbfa2a3466fe985e1bd810856afb0b0 Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Thu, 6 Feb 2020 21:13:38 +0100 Subject: [PATCH] feat: Add @typescript-eslint/explicit-module-boundary-types BREAKING CHANGE: Exported functions now need to specify an explicit return type. This enforces everyone to be explicit about the public interface of the module. This is likely to increase the developer experience because type errors will show up closer to the actual error. --- typescript.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/typescript.js b/typescript.js index 3eb8ab2..bac1803 100644 --- a/typescript.js +++ b/typescript.js @@ -76,6 +76,12 @@ module.exports = { }, }, ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md + "@typescript-eslint/explicit-module-boundary-types": ["error", { + allowDirectConstAssertionInArrowFunctions: true, + allowHigherOrderFunctions: true, + allowTypedFunctionExpressions: true, + allowedNames: [], + }], // https://github.com/typescript-eslint/typescript-eslint/blob/v2.19.0/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md "@typescript-eslint/func-call-spacing": ["error"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md "@typescript-eslint/generic-type-naming": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/generic-type-naming.md "@typescript-eslint/indent": ["error", 4, options["indent"]], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md