@iampava-devtools-ds/diagnostic
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

@iampava-devtools-ds/diagnostic

The Diagnostic component displays errors and warnings from code, similar to errors produced by tools like webpack. It can also be used to display errors produced by a Language Server.

Installation

npm i @iampava-devtools-ds/diagnostic
# or with yarn
yarn add @iampava-devtools-ds/diagnostic

Accessibility Approach

The Diagnostic is a block of preformatted text that can be difficult for screen readers to read. Based on this, we followed the MDN suggestion to treat the component as a figure. There is an auto-generated caption describing the error in a screen-reader friendly way.

Usage

import { Diagnostic } from "@iampava-devtools-ds/diagnostic";

Basic Diagnostic

<Diagnostic message={message} lines={lines} severity={severity} />

Diagnostic Using Language Server

import { DiagnosticSeverity } from "vscode-languageserver-types";

<Diagnostic
  message={message}
  lines={lines}
  severity={transformLanguageServer(DiagnosticSeverity.Error)}
/>;

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Shelby Cohen

💻 🎨

Tyler Krupicka

💻 📖 🎨 🚇 💡 ⚠️

Adam Dierkens

🎨 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Readme

Keywords

none

Package Sidebar

Install

npm i @iampava-devtools-ds/diagnostic

Weekly Downloads

1

Version

1.2.5

License

MIT

Unpacked Size

53.1 kB

Total Files

20

Last publish

Collaborators

  • iampava