@@ -57,13 +57,23 @@ result.map // source map object
5757
5858### Errors
5959
60- Errors will have ` error.position ` , just like [ ` node.position ` ] ( #position ) . The
61- error contains the source position in the message. To get the error message
62- without the position use ` error.reason ` .
60+ Errors thrown during parsing have the following properties:
61+
62+ - message: ` String ` . The full error message with the source position.
63+ - reason: ` String ` . The error message without position.
64+ - filename: ` String ` or ` undefined ` . The value of ` options.source ` if
65+ passed to ` css.parse ` . Otherwise ` undefined ` .
66+ - line: ` Integer ` .
67+ - column: ` Integer ` .
68+ - source: ` String ` . The portion of code that couldn't be parsed.
69+
70+ When parsing with the ` silent ` option, errors are listed in the
71+ ` parsingErrors ` property of the [ ` stylesheet ` ] ( #stylesheet ) node instead
72+ of being thrown.
6373
6474If you create any errors in plugins such as in
65- [ rework] ( https://github.com/reworkcss/rework ) , you __ must__ set the ` position `
66- as well for consistency.
75+ [ rework] ( https://github.com/reworkcss/rework ) , you __ must__ set the same
76+ properties for consistency.
6777
6878## AST
6979
@@ -115,6 +125,8 @@ The root node returned by `css.parse`.
115125- stylesheet: ` Object ` :
116126 - rules: ` Array ` of nodes with the types ` rule ` , ` comment ` and any of the
117127 at-rule types.
128+ - parsingErrors: ` Array ` of ` Error ` s. Errors collected during parsing when
129+ option ` silent ` is true.
118130
119131#### rule
120132
0 commit comments