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

use node.error for CSS relevant errors #540

Merged
merged 2 commits into from Aug 1, 2023

Conversation

romainmenke
Copy link
Collaborator

fixes #518

I've kept the new Error() when checking plugin options.
I don't think these are CSS syntax errors : https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#41-use-nodeerror-on-css-relevant-errors

`Failed to find '${id}'
in [
${paths.join(",\n ")}
${paths.join(",\n ")}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent before :

    message: `postcss-import: <css input>:3:1: Failed to find 'layer\`\`\`.css'␊
      in [␊
        /projects/postcss-import,␊
            /projects/postcss-import/test/fixtures/imports␊
      ]`,

Indent now :

    message: `postcss-import: <css input>:3:1: Failed to find 'layer\`\`\`.css'␊
      in [␊
        /projects/postcss-import,␊
        /projects/postcss-import/test/fixtures/imports␊
      ]`,

Copy link
Collaborator

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need /s flag in new test regexes

test/layer.js Outdated Show resolved Hide resolved
test/plugins.js Outdated Show resolved Hide resolved
Co-authored-by: Ryan Zimmerman <opensrc@ryanzim.com>
@romainmenke romainmenke merged commit 3a2e231 into master Aug 1, 2023
3 checks passed
@romainmenke romainmenke deleted the fix-518--unassuming-red-panda-a78a06ed7a branch August 1, 2023 14:54
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.

Use the dedicated PostCSS API for errors
2 participants