KC's Workspace
    Preparing search index...

    Represents a plugin’s warning. It can be created using Node#warn.

    if (decl.important) {
    decl.warn(result, 'Avoid !important', { word: '!important' })
    }
    Index

    Constructors

    Properties

    column: number

    Column for inclusive start position in the input file with this warning’s source.

    warning.column //=> 6
    
    endColumn?: number

    Column for exclusive end position in the input file with this warning’s source.

    warning.endColumn //=> 4
    
    endLine?: number

    Line for exclusive end position in the input file with this warning’s source.

    warning.endLine //=> 6
    
    line: number

    Line for inclusive start position in the input file with this warning’s source.

    warning.line //=> 5
    
    node: Node

    Contains the CSS node that caused the warning.

    warning.node.toString() //=> 'color: white !important'
    
    plugin: string

    The name of the plugin that created this warning. When you call Node#warn it will fill this property automatically.

    warning.plugin //=> 'postcss-important'
    
    text: string

    The warning message.

    warning.text //=> 'Try to avoid !important'
    
    type: "warning"

    Type to filter warnings from Result#messages. Always equal to "warning".

    Methods

    • Returns a warning position and message.

      warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
      

      Returns string

      Warning position and message.