Skip to content

Use the dedicated PostCSS API for errors #518

@binyamin

Description

@binyamin

PostCSS has a dedicated API method for errors. This codebase is inconsistent. It only uses it in lib/assign-layer-names.js.

For example:

throw new Error(
`Failed to find '${id}'
in [
${paths.join(",\n ")}
]`

Also:

postcss-import/index.js

Lines 261 to 265 in b7d1939

throw new Error(
`Incompatable @charset statements:
${stmt.node.params} specified in ${stmt.node.source.input.file}
${charset.node.params} specified in ${charset.node.source.input.file}`
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions