43081j / postcss-lit

PostCSS syntax for extracting CSS from template literals inside JS/TS files
84 stars 6 forks source link

Improve warning output #57

Closed adrianbruntonsagecom closed 3 months ago

adrianbruntonsagecom commented 4 months ago

Improves warning output when the plugin could not interpret the code sufficiently to include the file containing the issue.

Before:

[postcss-lit] Skipping template (Line [line]) as it included either invalid syntax or complex expressions the plugin could not interpret. Consider using a "// postcss-lit-disable-next-line" comment to disable this message

After:

[postcss-lit] Skipping template ([path]:[line]) as it included either invalid syntax or complex expressions the plugin could not interpret. Consider using a "// postcss-lit-disable-next-line" comment to disable this message

43081j commented 3 months ago

CI is failing presumably because opts.from can be undefined (as can opts)

may be worth just having something like this somewhere:

const errLocation = `${opts?.from ?? 'unknown'}:${node.loc.start.line}` ;
adrianbruntonsagecom commented 3 months ago

CI is failing presumably because opts.from can be undefined (as can opts)

may be worth just having something like this somewhere:

const errLocation = `${opts?.from ?? 'unknown'}:${node.loc.start.line}` ;

Thanks - should be sorted now :)

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8230808334

Details


Totals Coverage Status
Change from base Build 7187746188: 0.006%
Covered Lines: 901
Relevant Lines: 909

💛 - Coveralls
coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8230808334

Details


Totals Coverage Status
Change from base Build 7187746188: 0.006%
Covered Lines: 901
Relevant Lines: 909

💛 - Coveralls
43081j commented 3 months ago

all looks good now 👍

ill cut a release this weekend if i can