This package has been deprecated

Author message:

This package is deprecated, see https://github.com/stylelint/vscode-stylelint/issues/110 for upcoming new release

stylelint-processor-name-to-vscode-language-ids

0.0.0 • Public • Published

stylelint-warning-to-vscode-diagnostic

NPM version Build Status Coverage Status

Convert a stylelint warning into a Visual Studio Code diagnostic

const {lint} = require('stylelint');
const stylelintWarningToVscodeDiagnostic = require('stylelint-warning-to-vscode-diagnostic');
 
async () => {
  const {results: [{warnings}]} = await lint({
    code: 'a { color: red; }',
    config: {
      rules: {
        'color-named': 'never'
      }
    }
  });
 
  warnings[0];
  /* {
    rule: 'color-named',
    text: 'Unexpected named color "red" (color-named)',
    severity: 'error',
    line: 1,
    column: 12
  } */
 
  stylelintWarningToVscodeDiagnostic(warnings[0]);
  /* {
    message: 'Unexpected named color "red" (color-named)',
    severity: 1,
    source: 'stylelint',
    range: {
      start: {
        line: 0,
        character: 11
      },
      end: {
        line: 0,
        character: 11
      }
    }
  } */
};

Installation

Use npm.

npm install stylelint-warning-to-vscode-diagnostic

API

const stylelintWarningToVscodeDiagnostic = require('stylelint-warning-to-vscode-diagnostic');

stylelintWarningToVscodeDiagnostic(warning)

warning: Object (stylelint warning)
Return: Object (VS Code diagnostic)

License

Copyright (c) 2017 Shinnosuke Watanabe

Licensed under the MIT License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i stylelint-processor-name-to-vscode-language-ids

Weekly Downloads

1

Version

0.0.0

License

MIT

Last publish

Collaborators

  • ntwb