Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

firescript-linter

firetux11MIT0.15.1

Linter for Firescript

firescript, lint, linter

readme

Firescript Linter

Linter module for Firescript and Firelint

Usage

import FirescriptParser from 'firescript-parser'
import FirescriptLinter from 'firescript-linter'

const source = '''
    const num = 42
    log num, foo
    # Foo is not defined
'''
const parser = new FirescriptParser()
const fst = parser.parse(source)

const linter = new FirescriptLinter()
const lintResult = linter.lint(fst)
Lint result:
{
  "exceptions": [
    {
      "node": {
        "type": "Identifier",
        "name": "foo"
      },
      "location": [10, 1, 12, 1],
      "exception": "VARIABLE_NOT_DECLARED",
      "message": "Variable foo not declared",
      "varName": "foo"
    }
  ],
  "status": "failed"
}