Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Latest commit

 

History

History
44 lines (27 loc) · 1.65 KB

README.md

File metadata and controls

44 lines (27 loc) · 1.65 KB

Flycheck checker for json-mode using jsonlint from demjson

This package provides a flycheck checker for json-mode using jsonlint from demjson.

Why another JSON checker

The built in JSON checker uses zaach/jsonlint which has no rules support, but jsonlint from demjson has a set of options let you control which checks are to be performed, e.g. trailing-comma is allowed in .eslintrc but forbidden in package.json.

Installation

  1. Uninstall zaach/jsonlint if necessary to avoid conflicts:

    npm -g uninstall jsonlint

  2. Install demjson, more info at installing-demjson:

    pip install demjson or easy_install demjson

  3. Install flycheck-demjsonlint which is available from MELPA:

    M-x package-install [RET] flycheck-demjsonlint [RET].

Configuration

(require 'flycheck-demjsonlint)

Lint Rules(.demjsonrc)

  • Built-in support: .eslintrc, package.json
  • Precedence: ~/.demjsonrc over pkg-dir/.demjsonrc
  • Format: one record per line, filename=jsonlint-cmd-options, e.g. .eslintrc=-S
  • Implementation: demjsonlint is just a wrapper of jsonlint from demjson, jsonlint-cmd-options is passed to jsonlint as is