valid-describe: warn if first argument is a function
See original GitHub issueFrom 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:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
@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. 😄