JSPM

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

3.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 528
  • Score
    100M100P100Q109995F
  • License Apache-2.0

A source files for code mirror linter files

Package Exports

  • @advanced-rest-client/code-mirror-linter
  • @advanced-rest-client/code-mirror-linter/code-mirror-linter.js
  • @advanced-rest-client/code-mirror-linter/lint-style.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@advanced-rest-client/code-mirror-linter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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