Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when you import invalid values #39

Open
cesarandreu opened this issue Mar 3, 2016 · 0 comments
Open

Fail when you import invalid values #39

cesarandreu opened this issue Mar 3, 2016 · 0 comments

Comments

@cesarandreu
Copy link

It would be extremely useful to get errors when you import a value which doesn't exist.

I've been using module values for a couple months now, and silent failures have definitely been one of my bigger pain-points.

(In the following example, the components folder would be symlinked to node_modules/components.)

For example:

components/styles/colors.css

@value Primary: #2196F3;

components/Foo/Foo.css

@value colors: 'components/styles/colors.css';
@value Primarry from colors;

.foo {
  background-color: Primarry;
}

In this scenario, it's a small typo, where I accidentally added an extra r when naming the imported value, and when I was typing the background color I just hit tab to autocomplete.

I've somewhat worked around this variation of the issue by using editor plugins such as All Autocomplete.

However, the other scenario in which it fails is when you're refactoring. There's no easy way of confirming that a value is no longer being used anywhere. On the other hand, if deleting a value from colors.css caused compilation to fail, I could follow the errors and update all references.

Would it be feasible to implement this kind of behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants