Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/bundler/deps.ts>postcss.Warning

A Bundler with the web in mind.
Go to Latest
class postcss.Warning
Re-export
import { postcss } from "https://deno.land/x/bundler@0.6.5/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 in the input file with this warning’s source.

warning.column //=> 6
line: number

Line 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'