yaml-eslint-parser failing with cloudformation template

33 views Asked by At

Installed eslint-plugin-yaml in my node project with typescript as per https://www.npmjs.com/package/eslint-plugin-yaml. But running eslint command fails to parse AWS SAM cloud formation template. Where ever it encounters :: it says "Parsing error: Unexpected token :". Another error is "Parsing error: Unexpected character '#'" for comments

esrlintrc

{
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:prettier/recommended",
    "plugin:yml/recommended"       
  ],
  "parser": "@typescript-eslint/parser",
  "overrides": [
    {
      "files": ["*.yaml", "*.yml"],
      "parser": "yaml-eslint-parser"
    }
  ],
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module",
    "project": "tsconfig.json",
    "defaultYAMLVersion": "1.2"
  },
  "plugins": [
    "eslint-plugin-yml",
    "@typescript-eslint"
  ]  
}
0

There are 0 answers