New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(eslint-plugin): [explicit-function-return-type] add allowedNames #4440
Merged
bradzacher
merged 15 commits into
typescript-eslint:main
from
islandryu:featAddallowedNames
Feb 2, 2022
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5e2c4fd
feat(eslint-plugin): [explicit-function-return-type] add allowedNames…
islandryu f931a38
feat(eslint-plugin): [explicit-function-return-type] afix typecheck
islandryu edd64e8
Merge branch 'main'
islandryu b383ff6
Update packages/eslint-plugin/src/rules/explicit-function-return-type.ts
islandryu f48f8d7
Merge branch 'featAddallowedNames' of https://github.com/islandryu/ty…
islandryu f03d6e2
feat(eslint-plugin): [explicit-function-return-type] Change to allowe…
islandryu 2728975
feat(eslint-plugin): [explicit-function-return-type] Change to allowe…
islandryu 690986d
fix(eslint-plugin): [explicit-function-return-type] fix for codecov
islandryu 1e38d1d
fix(eslint-plugin): [explicit-function-return-type] add test
islandryu d8d39e6
fix(eslint-plugin): [explicit-function-return-type] add test
islandryu 39d6715
fix(eslint-plugin): [explicit-function-return-type] fix for codecov
islandryu a79ac5f
Merge branch 'main' into featAddallowedNames
8d66aa2
Merge branch 'main' into featAddallowedNames
islandryu 545b2ab
fix(eslint-plugin): [explicit-function-return-type] Change allowedNam…
islandryu 65103ff
Merge branch 'featAddallowedNames' of https://github.com/islandryu/ty…
islandryu File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor problem with this code:
This is valid code! Which obviously should not be ignored.
Only checking for
.key.type === 'Identifier'
will match this case.You should also assert that
.computed === false
.cc @JoshuaKGoldberg as an FYI - this is a really common case that everyone (including me!) always forgets for properties of all kinds AND for member expressions as well.
I raised the issue with the estree spec but the outcome there was really "spec can't change".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks for the spot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I didn't know such a pattern existed.
@bradzacher
I changed the computed name so that it is not ignored by the allowedName.