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
If a user writes something like @use "foo" as foo, the as foo is totally redundant since it's the same as the default namespace that the @use rule would provide on its own. It would be nice to have a lint for this case.
The text was updated successfully, but these errors were encountered:
Based on the Sass @use documentation and the Sass Module System spec, I think a good name would be at-use-no-redundant-namespace. I quite like "alias" too, but the as-clause is not described with that term anywhere in the official documentation.
It took me a few months of occasional @use usage to discover that there was in fact a default namespace, extracted from the last component of the import URL. I’d almost be tempted to ask for the opposite rule (or a true/false at-use-redundant-namespace) to mandate the redundancy – I find this automatic default very un-intuitive since the import path otherwise looks like any other string.
It might just be a matter of getting used to / seeing it used more / having better syntax highlighting that highlights the last component of the path as an identifier – but for now, I’d rather do:
If a user writes something like
@use "foo" as foo
, theas foo
is totally redundant since it's the same as the default namespace that the@use
rule would provide on its own. It would be nice to have a lint for this case.The text was updated successfully, but these errors were encountered: