Skip to content
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-template): [no-call-expression] add allowList option #1217

Conversation

sandikbarr
Copy link
Contributor

Resolves #1055

Adds allowList option to the no-call-expression template rule to configure a list of function names allowed to be called.

@codecov
Copy link

codecov bot commented Nov 20, 2022

Codecov Report

Merging #1217 (7cf8cdd) into main (de2994c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 7cf8cdd differs from pull request most recent head f50b11a. Consider uploading reports for the commit f50b11a to get more accurate results

@@            Coverage Diff             @@
##             main    #1217      +/-   ##
==========================================
+ Coverage   88.06%   88.07%   +0.01%     
==========================================
  Files         162      162              
  Lines        3141     3144       +3     
  Branches      506      507       +1     
==========================================
+ Hits         2766     2769       +3     
  Misses        261      261              
  Partials      114      114              
Flag Coverage Δ
unittest 88.07% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...n-template/tests/rules/no-call-expression/cases.ts 100.00% <ø> (ø)
...nt-plugin-template/src/rules/no-call-expression.ts 100.00% <100.00%> (ø)

@@ -35,6 +51,15 @@ export default createESLintRule<Options, MessageIds>({

if (isChildOfBoundEvent) return;

if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to create a helper function for this logic, like seen in other rules? Something like functionNameIsAllowed could make this easier to understand. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good call, would keep this concise. I will update.

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Sandi! 🙏

@JamesHenry JamesHenry merged commit a69c809 into angular-eslint:main Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[no-call-expression] Add support for including/excluding specific functions
3 participants