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): [no-explicit-any] ignoreRestArgs #548

Merged
merged 4 commits into from Jun 16, 2019
Merged

feat(eslint-plugin): [no-explicit-any] ignoreRestArgs #548

merged 4 commits into from Jun 16, 2019

Conversation

Dilatorily
Copy link
Contributor

Closes #397

@codecov
Copy link

codecov bot commented May 22, 2019

Codecov Report

Merging #548 into master will increase coverage by 0.06%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #548      +/-   ##
==========================================
+ Coverage   94.19%   94.26%   +0.06%     
==========================================
  Files         105      104       -1     
  Lines        4323     4252      -71     
  Branches     1185     1160      -25     
==========================================
- Hits         4072     4008      -64     
+ Misses        146      142       -4     
+ Partials      105      102       -3
Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/no-explicit-any.ts 100% <100%> (ø) ⬆️
...s/experimental-utils/src/eslint-utils/deepMerge.ts 88.23% <0%> (-5.1%) ⬇️
...-plugin/src/rules/explicit-function-return-type.ts 97.29% <0%> (-2.71%) ⬇️
packages/eslint-plugin/src/rules/index.ts 100% <0%> (ø) ⬆️
...experimental-utils/src/eslint-utils/RuleCreator.ts 0% <0%> (ø) ⬆️
packages/typescript-estree/src/convert-comments.ts 96% <0%> (ø) ⬆️
packages/experimental-utils/src/index.ts 0% <0%> (ø) ⬆️
...ges/experimental-utils/src/ts-eslint/RuleTester.ts 0% <0%> (ø) ⬆️
...es/eslint-plugin/src/rules/no-floating-promises.ts
...-plugin/src/rules/no-unnecessary-type-assertion.ts 91.17% <0%> (+0.38%) ⬆️
... and 2 more

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.

Thanks for your contribution!

A few things for you:

  1. you need to add support for more cases of function definitions:
function foo1(...args: any[]) {}
const bar1 = function (...args: any[]) {}
const baz1 = (...args: any[]) => {}

// readonly array[]:
function foo2(...args: readonly any[]) {}
const bar2 = function (...args: readonly any[]) {}
const baz2 = (...args: readonly any[]) => {}

// generics
function foo3(...args: Array<any>) {}
const bar3 = function (...args: Array<any>) {}
const baz3 = (...args: Array<any>) => {}
function foo4(...args: ReadonlyArray<any>) {}
const bar4 = function (...args: ReadonlyArray<any>) {}
const baz4 = (...args: ReadonlyArray<any>) => {}

should these be valid as well? Technically they're valid typescript, but they make less sense semantically. Probably good to guard against them.

function foo5(...args: any) {}
const bar5 = function (...args: any) {}
const baz5 = (...args: any) => {}
  1. Please add examples to the docs to help explain the option's function

@bradzacher bradzacher added the enhancement: plugin rule option New rule option for an existing eslint-plugin rule label May 22, 2019
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

@bradzacher bradzacher added the 1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready label May 23, 2019
@bradzacher bradzacher changed the title feat(eslint-plugin): [no-explicit-any] ignoreRestArgs (#397) feat(eslint-plugin): [no-explicit-any] ignoreRestArgs Jun 16, 2019
@bradzacher bradzacher merged commit 753ad75 into typescript-eslint:master Jun 16, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready enhancement: plugin rule option New rule option for an existing eslint-plugin rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[no-explicit-any] Add ignore-rest-args equivalent option from tslint's no-any
2 participants