firescript-linter

Linter for Firescript

Usage no npm install needed!

<script type="module">
  import firescriptLinter from 'https://cdn.skypack.dev/firescript-linter';
</script>

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