Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99078

Turn off error for console.log on my eslint

$
0
0

I'm trying to turn off lint warning for my eslint at VS code.

My code is contains.

console.log('blabla..');

eslint said as below.

 error  Unexpected console statement                      no-console

Even though already add no-restricted-syntax at my .eslintrc.json, no fixed.

Here is my .eslintrc.json

{
    "env": {
        "es6": true,
        "node": true,
        "amd": true,
        "mocha": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 2017,
        "sourceType": "module"
    },
    "rules": {
        "linebreak-style": [
            "error",
            "windows"
        ],
        "no-restricted-syntax": [
            "error",
            {
                "selector": "CallExpression[callee.object.name='console'][callee.property.name=/^(log|warn|error|info|trace)$/]",
                "message": "Unexpected property on console object was called"
            }
        ]
    }
}

What did I mistake?


Viewing all articles
Browse latest Browse all 99078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>