@advanced-rest-client/code-mirror-linter
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

Build Status

Sets of linters for advanced-rest-client/code-mirror

Usage

Installation

npm install --save @advanced-rest-client/code-mirror-linter

In a LitElement

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/code-mirror/code-mirror.js';
import '@advanced-rest-client/code-mirror-linter/code-mirror-linter-json';
import linterStyles from '@advanced-rest-client/code-mirror-linter/lint-style.js';

class SampleElement extends PolymerElement {
  static get styles() {
    return [
      linterStyles,
      css`:host { ... }`
    ];
  }

  render() {
    const gutters = ['CodeMirror-lint-markers'];
    return html`
    <code-mirror
      mode="application/json"
      linenumbers
      .gutters="${gutters}"
      .lint="${CodeMirror.lint.json}">
      {
        "a": 'b',
        "value": true
      }
      </code-mirror>
    `;
  }

  _valueHandler(e) {
    this.value = e.detail.value;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/code-mirror-linter
cd code-mirror-linter
npm install

Running the demo locally

npm start

Running the tests

npm test

API components

This components is a part of API components ecosystem

Package Sidebar

Install

npm i @advanced-rest-client/code-mirror-linter

Weekly Downloads

489

Version

3.0.2

License

Apache-2.0

Unpacked Size

43.3 kB

Total Files

21

Last publish

Collaborators

  • carowright
  • jarrodek
  • twoplustwoone
  • lbauret