You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like builtin functions to verify that they were called with the correct number of arguments, and that the function's return value makes sense in context. Silently ignoring these two problems can make debugging incredibly difficult.
Real world example: Being used to LESS, I tried to use the contrast function like this:
background-color: contrast(#111, #222, #333)
Obviously, this is wrong in stylus - contrast accepts at most 2 arguments, and it doesn't return a color. But the compiler silently ignores both of these problems, outputting
I was using the Stylus browser addon and never got to see the compiled CSS, so all I had to figure out the problem was a weird error message complaining about unexpected {.
Ideally, I'd like to receive two error messages:
Function 'contrast' accepts at most 2 arguments, but received 3.
Line 1:
background-color: contrast(#111, #222, #333)
'background-color' requires a value of type 'color', but received 'object'.
Line 1:
background-color: contrast(#111, #222, #333)
The text was updated successfully, but these errors were encountered:
Function 'contrast' accepts at most 2 arguments, but received 3. Line 1: background-color: contrast(#111, #222, #333)
but not to
'background-color' requires a value of type 'color', but received 'object'. Line 1: background-color: contrast(#111, #222, #333)
this is the work of a linter, not of a preprocessor like stylus, also it will be hard to know what every property expected value is, and making it flexible enough for properties like font, not to mention the changes of the properties and the fact that new properties get added by time, its not the responsibility of stylus to track that
I'd like builtin functions to verify that they were called with the correct number of arguments, and that the function's return value makes sense in context. Silently ignoring these two problems can make debugging incredibly difficult.
Real world example: Being used to LESS, I tried to use the
contrast
function like this:Obviously, this is wrong in stylus -
contrast
accepts at most 2 arguments, and it doesn't return a color. But the compiler silently ignores both of these problems, outputtingI was using the Stylus browser addon and never got to see the compiled CSS, so all I had to figure out the problem was a weird error message complaining about unexpected
{
.Ideally, I'd like to receive two error messages:
The text was updated successfully, but these errors were encountered: