michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

[Question] Bind operator syntax highlighting #46

Closed safizn closed 5 years ago

safizn commented 5 years ago

I'm not sure how to configure this extension to support bind operator that is implemented in:

Cannot figure it out 🤔

safizn commented 5 years ago

Added jsconfig.json file to my project, doesn't seem to work:

{
    "compilerOptions": {
        "target": "esnext", 

    },
    "exclude": [
        "node_modules"
    ]
}
safizn commented 5 years ago

Should I turn off the built in Typescript linter that validates also .js files, when using ESlint ? In VSCode settings: {"javascript.validate.enable": false}`

safizn commented 5 years ago

Got it to work, the VSCode built-in tslint confused me as it runs implicitly. Turns out ESLint works independent of the built-in parser & linter, therefore it should be turned off to prevents errors appearing from it. Using javascript.validate.enable in the VSCode settings does it globaly which will require setting ESLint for all projects. https://stackoverflow.com/questions/36327096/vscode-linter-es6-es7-babel-linter

& Adding babel-parser does support out of the box bind operator and parsing other experimental features.

.eslintrc.js:

module.exports = {
    parser: "babel-eslint",
    "parserOptions": {
    },
    "rules": {
    },
    env: {
    }
};