question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

valid-describe: warn if first argument is a function

See original GitHub issue

From https://github.com/jest-community/eslint-plugin-jest/pull/57#discussion_r167249781

Report in the valid-describe rule for the following case:

describe(() => {})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SimenBcommented, Feb 10, 2018

The commit message must follow the form of “feat: some added feature”. We use these semantic commits to publish from CI.

See http://karma-runner.github.io/2.0/dev/git-commit-msg.html

1reaction
macklinucommented, Feb 9, 2018

@brianlmacdonald go for it - thanks!

I noticed that the valid-describe rule falsely reports this as valid:

https://github.com/jest-community/eslint-plugin-jest/blob/5e01e6b2caa7205ab4f5537ab33ce81feff4dad7/rules/__tests__/valid-describe.test.js#L14

when I believe that describe() always requires two parameters (name: string, fn: Function), which is something I missed in #57.

If you’re feeling up for correcting that test case in your PR, that would be awesome too. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Check existence of input argument in a Bash shell script
It is: if [ $# -eq 0 ] then echo "No arguments supplied" fi. The $# variable will tell you the number of...
Read more >
Parameters and Arguments - Lingo in a Nutshell [Book] - O'Reilly
Warning. Even though it is an error, Lingo does not complain if the first argument to a function call is an undeclared local...
Read more >
Communicate lifecycle changes in your functions
lifecycle provides deprecate_warn() which takes three main arguments: The first argument, when , gives the version number when the deprecation occurred. The ...
Read more >
The arguments object - JavaScript - MDN Web Docs - Mozilla
It has entries for each argument the function was called with, with the first entry's index at 0 . For example, if a...
Read more >
Functions - The Modern JavaScript Tutorial
The function keyword goes first, then goes the name of the function, ... If a function is called, but an argument is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found