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

fix(eslint-plugin): no-explicit-any constructor functions (& more) not ignored by ignoreRestArgs property #1711

Merged
merged 15 commits into from Apr 3, 2020

Conversation

N2D4
Copy link
Contributor

@N2D4 N2D4 commented Mar 9, 2020

Previously, the following were not ignored by the no-explicit-any rule if the ignoreRestArgs property was given:

declare class A { f(...args: any[]): unknown; } // AST_NODE_TYPES.TSEmptyBodyFunctionExpression
type T = new (...args: any[]) => unknown // AST_NODE_TYPES.TSConstructorType
type T = {new (...args: any[]): unknown} // AST_NODE_TYPES.TSConstructSignatureDeclaration
type T = {f(...args: any[]): unknown}; // AST_NODE_TYPES.TSMethodSignature
declare function f(...args: any[]): unknown; // AST_NODE_TYPES.TSDeclareFunction

This PR fixes that.

@bradzacher bradzacher added the bug Something isn't working label Mar 9, 2020
@N2D4
Copy link
Contributor Author

N2D4 commented Mar 9, 2020

The code sample in the docs is now a little long, I'll shorten it if needed

@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #1711 into master will not change coverage by %.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1711   +/-   ##
=======================================
  Coverage   94.73%   94.73%           
=======================================
  Files         160      160           
  Lines        7300     7300           
  Branches     2092     2092           
=======================================
  Hits         6916     6916           
  Misses        164      164           
  Partials      220      220           
Flag Coverage Δ
#unittest 94.73% <ø> (ø)
Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/no-explicit-any.ts 92.85% <ø> (ø)

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for doing this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants