Eslint Parsing problem in sfra salesforce project

26 Views Asked by At

I have problem related to eslint .

I configured my eslintrc.json file ( folder level ) . add some rules there and everything is working fine ( if file doesn't has any problem ) ( I will mention this later what problem I mean )

this is my config file -> eslintrc.json

{
    "plugins": ["sitegenesis"],
    "rules": {
        "sitegenesis/no-global-require": 0,
        "import/no-unresolved": 0,
        "vars-on-top": 0,
        "no-else-return": 0,
        "quotes": 0,
        "no-var": 0,
        "one-var-declaration-per-line": 0,
        "one-var": 0,
        "quote-props": 0,
        "prefer-arrow-callback": 0,
        "space-after-keywords": 0,
        "space-before-keywords": 0,
        "import/extensions": 0,
        "consistent-return": 0,
        "padded-blocks": 0,
        "eqeqeq": 0,
        "no-useless-return": 0,
        "no-prototype-builtins": 0
    }
}

but , if my file contains some problematic parts , for example ->

var cartQty : Number = 0;

when I am hovering on this error it says -> Type annotations can only be used in TypeScript files.ts(8010)

and when I am linting erros it says -> error Parsing error: Unexpected token : ( and nothing more )

maybe you faced similar problem before if you can guide me or if you need more information I am ready to assist !

0

There are 0 best solutions below