Skip to main content
Module

x/bundler/deps.ts>postcss.Warning

A Bundler with the web in mind.
Latest
class postcss.Warning
Re-export
import { postcss } from "https://deno.land/x/bundler@0.9.0/deps.ts";
const { Warning } = postcss;

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

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

Constructors

new
Warning(text: string, opts?: WarningOptions)

Properties

column: number

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

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

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

warning.endColumn //=> 4
optional
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

toString(): string

Returns a warning position and message.

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