-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended
Description
The rule considers protected
class methods as public
, which contradicts the description in the plugin's docs:
Require explicit return and argument types on exported functions' and classes' public class methods
It's probably a matter of debate whether protected
functions should be considered "exported" and I think the best solution would be to have this configurable.
This rule is generally pretty annoying, as it requires putting : void
next to methods that don't return anything, but that's perhaps for another issue.
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
{
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"]
}
}
export default class Test {
testMethod() { // this produces an error, as expected
}
protected testMethod2() { // this produces an error, **but it shouldn't**
}
private testMethod3() { // this does not produce an error, as expected
}
}
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
3.9.1 |
@typescript-eslint/parser |
3.9.1 |
TypeScript |
3.9.7 |
ESLint |
7.7.0 |
node |
v12.18.2 |
Metadata
Metadata
Assignees
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended