Skip to content

eslint-plugin does not process .scxml files in visual studio code

Still having issues setting-up the linter for .scxml files in visual studio code. package.json dependencies look like this:

  "dependencies": {
    "@scion-scxml/scxml": "^4.3.25",
    "core-js": "^3.6.4",
    "eslint-plugin-promise": "^4.2.1",
    "readline-sync": "^1.4.10"
  },
  "devDependencies": {
    "@scion-scxml/debug": "^1.0.19",
    "@scion-scxml/eslint-plugin": "^4.0.23",
    "@scion-scxml/eslint-plugin-scharpie": "^4.0.16",
    "eslint": "^5.5.0"
  }

.eslintrc.json has:

{
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "globals": {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly"
    },
    "parserOptions": {
        "ecmaVersion": 2018,
        "sourceType": "module"
    },
    "rules": {
    }
}

settings.json has:

{
    "git.autofetch": true,
    "git.enableSmartCommit": true,
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "python.jediEnabled": false,
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        "scxml",
        "xml"
    ]
}

Adding the xml element at the top of the .scxml file (as shown below) enables syntax highlighting but causes lint error test scxml file:

<?xml version="1.0" encoding="UTF-8" ?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" >
    <state id="s0" />
</scxml>

error message: Parsing error: Unexpected token < eslint [1,1]

Running the command line version: npx eslint --plugin @scion-scxml/eslint-plugin test.scxml does not cause any error

Edited by Christophe Gerard
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information