-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
- 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
eslintrc.js
:
{
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error", { "allowedNames": ["foo1", "foo2"] }],
}
}
main.ts
:
export function foo1() {
return 0;
}
export const object = {
foo2() {
return 0;
},
};
tsconfig.json
:
{
"compilerOptions": {
"strict": true
}
}
Expected Result
I expect that allowedNames
will whitelist those methods.
Actual Result
This rule generates an error for foo1
and foo2
.
1:8 warning Missing return type on function @typescript-eslint/explicit-module-boundary-types
6:3 warning Missing return type on function @typescript-eslint/explicit-module-boundary-types
Additional Info
It works correctly when using arrow functions. This code gives no errors.
export const foo1 = () => 0;
export const foo2 = () => 0;
export const object = {
foo2,
};
This still errors, however.
export const object = {
foo2: () => 0,
};
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.15.0 |
@typescript-eslint/parser |
4.15.0 |
TypeScript |
4.1.5 |
ESLint |
7.19.0 |
node |
15.8.0 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin