Skip to content

Consistent format for CSS syntax errors #87

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

Merged
merged 1 commit into from
Aug 17, 2016

Conversation

andreypopp
Copy link
Contributor

I used babel-code-frame package formatting syntax errors code frames. That makes it consistent with Babel output which is I think very important as it makes it less cognitive efforts to recognize and process the error. Also code frames are a little bit fancies now (shows the line numebrs) so probably PostCSS itself should adopt this style.

You can also see that there's no duplicated filename in error message as webpack already print module name.

Before:

screenshot 2016-08-15 19 40 31

After:

screenshot 2016-08-15 19 39 19

@ai
Copy link
Contributor

ai commented Aug 15, 2016

Awesome. It will be very useful.

But maybe we should change it in PostCSS core? Could you send PR there?

@andreypopp
Copy link
Contributor Author

andreypopp commented Aug 15, 2016

Hey @ai, I'd be glad to make a PR to PostCSS core but this PR is specific to webpack as it doesn't render filename of the file errors happened into (something you don't want to miss in general case).

I'd suggest taking this PR here and then I'd make PostCSS reuse babel-code-frame for source code formatting.

@ai
Copy link
Contributor

ai commented Aug 15, 2016

Yeap:

  1. We could add line numbers to PostCSS core.
  2. Then we could fix file path in error in loader.

Looks good?

@andreypopp
Copy link
Contributor Author

Thanks @ai!
On Wed, 17 Aug 2016 at 18:07, Andrey Sitnik notifications@github.com
wrote:

Merged #87 #87.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#87 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAB3glJy-e-W1m1UYRrFaeKAUsR-UyC7ks5qgyPIgaJpZM4JkjIx
.

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

Successfully merging this pull request may close these issues.

2 participants