Skip to content

use node.error for CSS relevant errors#540

Merged
romainmenke merged 2 commits intomasterfrom
fix-518--unassuming-red-panda-a78a06ed7a
Aug 1, 2023
Merged

use node.error for CSS relevant errors#540
romainmenke merged 2 commits intomasterfrom
fix-518--unassuming-red-panda-a78a06ed7a

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

Co-authored-by: Ryan Zimmerman <opensrc@ryanzim.com>
@romainmenke romainmenke merged commit 3a2e231 into master Aug 1, 2023
@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