In the documentation for min() and max() it says "accepts any number of Number parameters" but if you give it more than 2 Number parameters there is a friendly error message. The function does work with >2 parameters and the error is unnecessary.
Here is the error:
🌸 p5.js says: max() was expecting no more than 2 arguments, but received 6. (on line 14 in sketch.js [file:///C:/---]). (http://p5js.org/reference/#/p5/max)
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
The FES here is checking the function call with the function signature as defined in the documentation, it has some limations so not all functions has parameter validation enabled. In this case parameter validation should probably be disabled for max() and probably min() as well.
@limzykenneth can I work on this issue??
P.S New to this project...
@TraXIcoN Sure, go ahead! I'll assign the issue to you.
I am not able to test the changes I made...
The error is coming similar to the one in this issue #2361
This is the error I am getting:-
``Running "eslint:build" (eslint) task
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.
⏎······· [Error/prettier/prettier]y.js:26:17: Replace ·?·'p5-test.js' with `
1 problem
Warning: Task "eslint:build" failed. Use --force to continue.
Aborted due to warnings.
npm ERR! Test failed. See above for more details.
```
I even did a clean npm install by removing the existing node_modules folder and the npm cache
Can you post some information about your environment? Node.js and NPM version, OS, etc.
OS: Windows 10 Version 1909(OS Build 18363. 1198)
Node.js: v13.11.0
npm: v6.13.7
Do you have any local eslint rule defined? Including in parent folders of where you are keeping the p5.js source code?
If you still can't identify an obvious source, can you try and edit where prettier is complaining about and see if you can get rid of the errors that way? If that is successful, go ahead and file a PR with those changes, I'll check it locally to see if those modifications causes any other problems.
Do you have any local eslint rule defined? Including in parent folders of where you are keeping the p5.js source code?
If you still can't identify an obvious source, can you try and edit where prettier is complaining about and see if you can get rid of the errors that way? If that is successful, go ahead and file a PR with those changes, I'll check it locally to see if those modifications causes any other problems.
I don''t know why the error was not clearing out....for now I just installed linux on my machine and did it :P
I will ask the windows problem in the discussion forum and see if anyone can help me with that...anyways this was a great first experience thanks for assigning me this issue!!
Most helpful comment
The FES here is checking the function call with the function signature as defined in the documentation, it has some limations so not all functions has parameter validation enabled. In this case parameter validation should probably be disabled for
max()and probablymin()as well.