Skip to content

Commit

Permalink
feat: Add @typescript-eslint/explicit-module-boundary-types
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhnns committed Feb 6, 2020
1 parent 5825b13 commit 3f106a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f106a0

Please sign in to comment.