firescript-linter

0.15.1 • Public • Published

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"
}

Readme

Keywords

Package Sidebar

Install

npm i firescript-linter

Weekly Downloads

35

Version

0.15.1

License

MIT

Unpacked Size

102 kB

Total Files

41

Last publish

Collaborators

  • andifeind
  • kippis
  • firetux